mirror of
https://github.com/imputnet/helium.git
synced 2026-08-20 00:57:32 +02:00
Compare commits
42 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1160f1b98d | |||
| ba6dce63e5 | |||
| f4ddea3723 | |||
| 32f0cf8c81 | |||
| 99f65cfbcd | |||
| b0f30bffcf | |||
| c8be580734 | |||
| 34fb66f3cb | |||
| a228d8d3e6 | |||
| 4a2db8bd77 | |||
| d5a8399923 | |||
| 06e5b89b3a | |||
| f1204f7694 | |||
| a0d6aa20e3 | |||
| 6771b17612 | |||
| c9845885f6 | |||
| 16ab1cf6fb | |||
| f8269d2587 | |||
| 5ec769b511 | |||
| aaffd20cda | |||
| 38e39f466b | |||
| e625432f33 | |||
| e19261507e | |||
| 92ebfbe654 | |||
| e68b57dfe6 | |||
| 45bb2e7044 | |||
| 1c903792d3 | |||
| f72d8b763b | |||
| d0c67ff7a3 | |||
| 22c8e702bb | |||
| fe05e0c361 | |||
| 2a3b46b1d8 | |||
| c62576f910 | |||
| 9247351f2a | |||
| 0caf5fe713 | |||
| 66e9d195b2 | |||
| 4acf516bbb | |||
| 18bc8e75e5 | |||
| 7df2e17c45 | |||
| 6888497c4f | |||
| 3cf2a3b65c | |||
| 82e76623df |
@@ -59,12 +59,15 @@ runs:
|
||||
|
||||
mkdir -p build/{src,download_cache}
|
||||
|
||||
# fetch soures, expect that patches apply cleanly (or die)
|
||||
run_upstream utils/downloads.py retrieve \
|
||||
-i "$HELIUM_DIR/downloads.ini" -c build/download_cache
|
||||
for file in "$HELIUM_DIR/downloads.ini" "$PLATFORM_DIR/downloads.ini"; do
|
||||
if ! [ -f "$file" ]; then continue; fi
|
||||
|
||||
run_upstream utils/downloads.py unpack \
|
||||
-i "$HELIUM_DIR/downloads.ini" -c build/download_cache build/src
|
||||
run_upstream utils/downloads.py retrieve \
|
||||
-i "$file" -c build/download_cache
|
||||
|
||||
run_upstream utils/downloads.py unpack \
|
||||
-i "$file" -c build/download_cache build/src
|
||||
done
|
||||
|
||||
run_upstream utils/patches.py apply \
|
||||
--no-fuzz build/src "$HELIUM_DIR/patches"
|
||||
@@ -78,7 +81,7 @@ runs:
|
||||
popd
|
||||
|
||||
# commit, push, make pr
|
||||
TITLE="update: helium-chromium $version_after"
|
||||
TITLE="update: helium $version_after"
|
||||
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
# Helium
|
||||
Bullshit-free web browser, based on Chromium. Follows [imput](https://github.com/imputnet)'s ethics and norms.
|
||||
|
||||
Very WIP, not meant for public/end user consumption, etc.
|
||||
|
||||
First and foremost, we're making a good browser for ourselves.
|
||||
We don't intend to reinvent the wheel or target everyone, it isn't Helium's goal.
|
||||
The main goal is to provide an honest, comfortable, privacy-respecting, and non-invasive experience.
|
||||
@@ -12,8 +10,11 @@ There's a lot more to Helium, but we don't have a complete set of features yet.
|
||||
We'll update the documentation when we're closer to a public release!
|
||||
|
||||
## Platform-specific packaging
|
||||
At the moment, we're only working on [Helium for macOS](https://github.com/imputnet/helium-macos).
|
||||
We plan to create packaging for Windows & Linux systems in the future, but that's over the horizon for now.
|
||||
At the moment, only [Helium for macOS](https://github.com/imputnet/helium-macos) is polished and ready for daily use.
|
||||
|
||||
We also have packaging for Linux and Windows, but both of them are WIP:
|
||||
- [Helium for Linux](https://github.com/imputnet/helium-linux) (AppImage)
|
||||
- [Helium for Windows](https://github.com/imputnet/helium-windows) (no auto-updates yet)
|
||||
|
||||
## Credits
|
||||
### ungoogled-chromium
|
||||
|
||||
@@ -1 +1 @@
|
||||
140.0.7339.80
|
||||
140.0.7339.185
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
// Copyright 2025 The Helium Authors
|
||||
// You can use, redistribute, and/or modify this source code under
|
||||
// the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
|
||||
// Program for updating the assets.json file in uB0 to disable all
|
||||
// outgoing connections before the user is able to consent to them.
|
||||
|
||||
const fs = require('fs');
|
||||
|
||||
const err = () => {
|
||||
console.error('usage: node clear-ublock-assets <path to uB0 assets.json');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const assets_path = process.argv[2] || err();
|
||||
|
||||
const stripURLs = (c) =>
|
||||
[c].flat().filter(s => !URL.canParse(s));
|
||||
|
||||
const breakKey = (obj, key_) => {
|
||||
const keys = Object.keys(obj);
|
||||
const idx = keys.indexOf(key_);
|
||||
|
||||
if (idx === -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (let key of keys.splice(idx)) {
|
||||
const val = obj[key];
|
||||
delete obj[key];
|
||||
|
||||
if (key === key_) {
|
||||
key = `^${key}`;
|
||||
}
|
||||
|
||||
obj[key] = val;
|
||||
}
|
||||
}
|
||||
|
||||
const clear = obj => {
|
||||
for (const filter of Object.values(obj)) {
|
||||
if (filter.off) {
|
||||
continue;
|
||||
}
|
||||
|
||||
filter.contentURL = stripURLs(filter.contentURL);
|
||||
breakKey(filter, 'cdnURLs');
|
||||
breakKey(filter, 'patchURLs');
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
fs.writeFileSync(
|
||||
assets_path,
|
||||
JSON.stringify(clear(
|
||||
JSON.parse(fs.readFileSync(
|
||||
assets_path
|
||||
))
|
||||
), null, '\t') + '\n'
|
||||
);
|
||||
@@ -11,8 +11,8 @@ set -gx QUILT_PATCHES "$REPO_ROOT/patches"
|
||||
set -gx QUILT_PUSH_ARGS "--color=auto"
|
||||
set -gx QUILT_DIFF_OPTS "--show-c-function"
|
||||
set -gx QUILT_PATCH_OPTS "--unified --reject-format=unified"
|
||||
set -gx QUILT_DIFF_ARGS "-p ab --no-timestamps --no-index --color=auto --sort"
|
||||
set -gx QUILT_REFRESH_ARGS "-p ab --no-timestamps --no-index --sort --strip-trailing-whitespace"
|
||||
set -gx QUILT_DIFF_ARGS "-p ab --no-timestamps --no-index --color=auto"
|
||||
set -gx QUILT_REFRESH_ARGS "-p ab --no-timestamps --no-index --strip-trailing-whitespace"
|
||||
set -gx QUILT_COLORS "diff_hdr=1;32:diff_add=1;34:diff_rem=1;31:diff_hunk=1;33:diff_ctx=35:diff_cctx=33"
|
||||
set -gx QUILT_SERIES_ARGS "--color=auto"
|
||||
set -gx QUILT_PATCHES_ARGS "--color=auto"
|
||||
|
||||
@@ -17,8 +17,8 @@ export QUILT_PATCHES="$REPO_ROOT/patches"
|
||||
export QUILT_PUSH_ARGS="--color=auto"
|
||||
export QUILT_DIFF_OPTS="--show-c-function"
|
||||
export QUILT_PATCH_OPTS="--unified --reject-format=unified"
|
||||
export QUILT_DIFF_ARGS="-p ab --no-timestamps --no-index --color=auto --sort"
|
||||
export QUILT_REFRESH_ARGS="-p ab --no-timestamps --no-index --sort --strip-trailing-whitespace"
|
||||
export QUILT_DIFF_ARGS="-p ab --no-timestamps --no-index --color=auto"
|
||||
export QUILT_REFRESH_ARGS="-p ab --no-timestamps --no-index --strip-trailing-whitespace"
|
||||
export QUILT_COLORS="diff_hdr=1;32:diff_add=1;34:diff_rem=1;31:diff_hunk=1;33:diff_ctx=35:diff_cctx=33"
|
||||
export QUILT_SERIES_ARGS="--color=auto"
|
||||
export QUILT_PATCHES_ARGS="--color=auto"
|
||||
|
||||
@@ -850,6 +850,7 @@ chrome/browser/ash/wallpaper_handlers/google_photos_wallpaper_handlers_unittest.
|
||||
chrome/browser/ash/wallpaper_handlers/sea_pen_fetcher.cc
|
||||
chrome/browser/ash/wallpaper_handlers/wallpaper_handlers.cc
|
||||
chrome/browser/autocomplete/autocomplete_browsertest.cc
|
||||
chrome/browser/autocomplete/chrome_aim_eligibility_service_browsertest.cc
|
||||
chrome/browser/autocomplete/chrome_autocomplete_provider_client_browsertest.cc
|
||||
chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier_unittest.cc
|
||||
chrome/browser/autocomplete/search_provider_unittest.cc
|
||||
|
||||
@@ -6,3 +6,12 @@ download_filename = chromium-%(_chromium_version)s-lite.tar.xz
|
||||
hash_url = chromium|chromium-%(_chromium_version)s-lite.tar.xz.hashes|https://commondatastorage.googleapis.com/chromium-browser-official/chromium-%(_chromium_version)s-lite.tar.xz.hashes
|
||||
output_path = ./
|
||||
strip_leading_dirs = chromium-%(_chromium_version)s
|
||||
|
||||
# If you are bumping this, you *NEED* to re-strip the assets.json
|
||||
# file *every time* by using `devutils/clear-ublock-assets.js`.
|
||||
[ublock_origin]
|
||||
version = 1.66.4
|
||||
url = https://github.com/imputnet/ublock-origin-crx/releases/download/%(version)s/uBlock0_%(version)s.crx
|
||||
sha256 = c2809bb4cd2f3a6b9ddfc5e165cba74a200cd80ca691521f73d98bf5ab5abcef
|
||||
download_filename = ublock-origin-%(version)s.zip
|
||||
output_path = third_party/ublock
|
||||
|
||||
+4
-2
@@ -1,3 +1,5 @@
|
||||
# Everything that's downloaded after cloning Chromium goes here.
|
||||
# It will not work from main downloads.ini
|
||||
[search_engines_data]
|
||||
url = https://gist.githubusercontent.com/wukko/2a591364dda346e10219e4adabd568b1/raw/e75ae3c4a1ce940ef7627916a48bc40882d24d40/nonfree-search-engines-data.tar.gz
|
||||
download_filename = nonfree-search-engines-data.tar.gz
|
||||
@@ -5,8 +7,8 @@ sha256 = 00a87050fa3f941d04d67fb5763991e0b8ea399a88b505ab0e56dd263f06864c
|
||||
output_path = ./third_party/search_engines_data/resources_internal
|
||||
|
||||
[onboarding]
|
||||
version = 202509081820
|
||||
version = 202509221633
|
||||
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 = 4eb5fba49c3ef63af2d9a163cfbff1ccc081e0713034587656aed277544cf35d
|
||||
sha256 = a32a0f55a0d8157e50613c1dc16bba16940d3610c1a7bb90a9d5e08dac4e6483
|
||||
output_path = ./components/helium_onboarding
|
||||
|
||||
@@ -237,7 +237,7 @@
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
--- a/chrome/browser/chrome_browser_interface_binders_webui.cc
|
||||
+++ b/chrome/browser/chrome_browser_interface_binders_webui.cc
|
||||
@@ -802,8 +802,6 @@ void PopulateChromeWebUIFrameBinders(
|
||||
@@ -803,8 +803,6 @@ void PopulateChromeWebUIFrameBinders(
|
||||
::mojom::app_service_internals::AppServiceInternalsPageHandler,
|
||||
AppServiceInternalsUI>(map);
|
||||
|
||||
@@ -952,7 +952,7 @@
|
||||
"//services/service_manager/public/cpp",
|
||||
"//services/strings",
|
||||
"//services/test/echo/public/mojom",
|
||||
@@ -8441,7 +8436,6 @@ test("unit_tests") {
|
||||
@@ -8444,7 +8439,6 @@ test("unit_tests") {
|
||||
#
|
||||
# TODO(crbug.com/417513088): Maybe merge with the non-android `deps` declaration above?
|
||||
deps += [
|
||||
@@ -960,7 +960,7 @@
|
||||
"//chrome:packed_resources_integrity_header",
|
||||
"//chrome/browser/apps:icon_standardizer",
|
||||
"//chrome/browser/apps/app_service",
|
||||
@@ -8474,7 +8468,6 @@ test("unit_tests") {
|
||||
@@ -8477,7 +8471,6 @@ test("unit_tests") {
|
||||
"//chrome/browser/profile_resetter:fake_profile_resetter",
|
||||
"//chrome/browser/resource_coordinator:tab_manager_features",
|
||||
"//chrome/browser/resources/new_tab_page_instant:resources_grit",
|
||||
|
||||
@@ -1830,7 +1830,7 @@
|
||||
"//components/safe_browsing/content/browser:safe_browsing_service",
|
||||
"//components/safe_browsing/content/browser/password_protection",
|
||||
"//components/safe_browsing/content/browser/password_protection:test_support",
|
||||
@@ -7112,7 +7111,6 @@ test("unit_tests") {
|
||||
@@ -7114,7 +7113,6 @@ test("unit_tests") {
|
||||
"//components/resources",
|
||||
"//components/safe_browsing:buildflags",
|
||||
"//components/safe_browsing/content/browser",
|
||||
@@ -1935,7 +1935,7 @@
|
||||
|
||||
--- a/components/enterprise/browser/reporting/report_util.cc
|
||||
+++ b/components/enterprise/browser/reporting/report_util.cc
|
||||
@@ -80,25 +80,6 @@ em::SettingValue TranslateSettingValue(
|
||||
@@ -79,25 +79,6 @@ em::SettingValue TranslateSettingValue(
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1961,7 +1961,7 @@
|
||||
em::ProfileSignalsReport::RealtimeUrlCheckMode TranslateRealtimeUrlCheckMode(
|
||||
enterprise_connectors::EnterpriseRealTimeUrlCheckMode mode) {
|
||||
switch (mode) {
|
||||
@@ -111,18 +92,6 @@ em::ProfileSignalsReport::RealtimeUrlChe
|
||||
@@ -110,18 +91,6 @@ em::ProfileSignalsReport::RealtimeUrlChe
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1982,7 +1982,7 @@
|
||||
device_signals::AvProduct av_product) {
|
||||
--- a/components/enterprise/browser/reporting/report_util.h
|
||||
+++ b/components/enterprise/browser/reporting/report_util.h
|
||||
@@ -19,17 +19,10 @@ std::string ObfuscateFilePath(const std:
|
||||
@@ -23,17 +23,10 @@ std::string ObfuscateFilePath(const std:
|
||||
enterprise_management::SettingValue TranslateSettingValue(
|
||||
device_signals::SettingValue setting_value);
|
||||
|
||||
|
||||
@@ -3934,7 +3934,7 @@
|
||||
#include "components/signin/public/base/signin_switches.h"
|
||||
#include "components/signin/public/identity_manager/identity_manager.h"
|
||||
#include "components/signin/public/identity_manager/tribool.h"
|
||||
@@ -350,8 +349,7 @@ void ManagedUserProfileNoticeUI::Initial
|
||||
@@ -351,8 +350,7 @@ void ManagedUserProfileNoticeUI::Initial
|
||||
// Change the text so that the "(Recommended)" label is not shown when the
|
||||
// admin has set merging data as the default option.
|
||||
bool profile_separation_data_migration_settings_optout =
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "components/translate/core/browser/translate_download_manager.h"
|
||||
#include "components/translate/core/browser/translate_manager.h"
|
||||
#include "components/translate/core/browser/translate_prefs.h"
|
||||
@@ -2179,6 +2180,7 @@ void RenderViewContextMenu::AppendPageIt
|
||||
@@ -2183,6 +2184,7 @@ void RenderViewContextMenu::AppendPageIt
|
||||
}
|
||||
|
||||
if (CanTranslate(/*menu_logging=*/true)) {
|
||||
|
||||
@@ -212,12 +212,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
IPC_ENUM_TRAITS_MIN_MAX_VALUE(user_data_importer::ImporterType,
|
||||
user_data_importer::TYPE_UNKNOWN,
|
||||
- user_data_importer::TYPE_EDGE)
|
||||
+ user_data_importer::TYPE_BRAVE)
|
||||
+ user_data_importer::TYPE_PERPLEXITY_COMET)
|
||||
#else
|
||||
IPC_ENUM_TRAITS_MIN_MAX_VALUE(user_data_importer::ImporterType,
|
||||
user_data_importer::TYPE_UNKNOWN,
|
||||
- user_data_importer::TYPE_BOOKMARKS_FILE)
|
||||
+ user_data_importer::TYPE_BRAVE)
|
||||
+ user_data_importer::TYPE_PERPLEXITY_COMET)
|
||||
#endif
|
||||
|
||||
IPC_ENUM_TRAITS_MIN_MAX_VALUE(user_data_importer::ImportItem,
|
||||
@@ -588,13 +588,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
</message>
|
||||
</if>
|
||||
+ <message name="IDS_IMPORTED_FROM_BOOKMARK_FOLDER" desc="Name for bookmark panel folder imported from another browser">
|
||||
+ Imported from <ph name="BROWSER_NAME">$1<ex>Chrome</ex></ph>.
|
||||
+ Imported from <ph name="BROWSER_NAME">$1<ex>Chrome</ex></ph>
|
||||
+ </message>
|
||||
+ <message name="IDS_EXTENSIONS_IMPORTER_LOCK_TITLE" desc="Dialog title for importer lock dialog">
|
||||
+ Import profile still in use
|
||||
+ </message>
|
||||
+ <message name="IDS_EXTENSIONS_IMPORTER_LOCK_TEXT" desc="The message to be displayed in the importer-lock dialog">
|
||||
+ To import extensions or other settings, please first close the browser you're importing from.
|
||||
+ To continue importing data, first close the browser you're importing from.
|
||||
+ </message>
|
||||
<message name="IDS_IMPORT_FROM_FIREFOX" desc="browser combo box: Mozilla Firefox">
|
||||
Mozilla Firefox
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
|
||||
Copyright (c) 2025, The Brave Authors
|
||||
Copyright (c) 2025, The Helium Authors
|
||||
|
||||
Alternatively, the contents of this file may be used under the terms
|
||||
of the GNU General Public License Version 3, as described below:
|
||||
|
||||
Copyright (C) 2025 The Helium Authors
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
--- a/extensions/browser/extension_registrar.cc
|
||||
+++ b/extensions/browser/extension_registrar.cc
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "content/public/browser/browser_context.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "content/public/browser/devtools_agent_host.h"
|
||||
+#include "extensions/browser/api/content_settings/content_settings_service.h"
|
||||
#include "extensions/browser/blocklist_extension_prefs.h"
|
||||
#include "extensions/browser/delayed_install_manager.h"
|
||||
#include "extensions/browser/disable_reason.h"
|
||||
@@ -534,6 +535,22 @@ void ExtensionRegistrar::AddComponentExt
|
||||
}
|
||||
|
||||
AddExtension(extension);
|
||||
+
|
||||
+ if (!IsExtensionEnabled(extension->id()))
|
||||
+ return;
|
||||
+
|
||||
+ // ContentSettingsStore::RegisterExtension is only called for default
|
||||
+ // components on the first run with a fresh profile. All restarts of the
|
||||
+ // browser after that do not call it. This causes ContentSettingsStore's
|
||||
+ // `entries_` to never insert the component ID and then
|
||||
+ // ContentSettingsStore::GetValueMap always returns nullptr. I don't think
|
||||
+ // Chromium is affected by this simply because they don't use content settings
|
||||
+ // from default component extensions.
|
||||
+ extension_prefs_->OnExtensionInstalled(
|
||||
+ extension, /*disable_reasons=*/{}, syncer::StringOrdinal(),
|
||||
+ extensions::kInstallFlagNone, std::string(), {} /* ruleset_checksums */);
|
||||
+ extensions::ContentSettingsService::Get(browser_context_)
|
||||
+ ->OnExtensionPrefsLoaded(extension->id(), extension_prefs_);
|
||||
}
|
||||
|
||||
void ExtensionRegistrar::RemoveComponentExtension(
|
||||
@@ -19,7 +19,7 @@
|
||||
"//third_party/widevine/cdm:headers",
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -183,6 +183,7 @@
|
||||
@@ -184,6 +184,7 @@
|
||||
#include "components/translate/core/common/translate_util.h"
|
||||
#include "components/trusted_vault/features.h"
|
||||
#include "components/ui_devtools/switches.h"
|
||||
|
||||
@@ -102,7 +102,7 @@ with limited CPU/memory resources and it is disabled by default.
|
||||
|
||||
--- a/chrome/browser/flag_descriptions.cc
|
||||
+++ b/chrome/browser/flag_descriptions.cc
|
||||
@@ -2657,6 +2657,10 @@ const char kMantisFeatureKeyDescription[
|
||||
@@ -2661,6 +2661,10 @@ const char kMantisFeatureKeyDescription[
|
||||
"Feature key to use the Mantis feature on ChromeOS.";
|
||||
#endif // BUILDFLAG(IS_CHROMEOS)
|
||||
|
||||
@@ -115,7 +115,7 @@ with limited CPU/memory resources and it is disabled by default.
|
||||
const char kMediaRouterCastAllowAllIPsDescription[] =
|
||||
--- a/chrome/browser/flag_descriptions.h
|
||||
+++ b/chrome/browser/flag_descriptions.h
|
||||
@@ -1548,6 +1548,9 @@ extern const char kMantisFeatureKeyName[
|
||||
@@ -1551,6 +1551,9 @@ extern const char kMantisFeatureKeyName[
|
||||
extern const char kMantisFeatureKeyDescription[];
|
||||
#endif // IS_CHROMEOS
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
#include "base/feature_list.h"
|
||||
#include "base/format_macros.h"
|
||||
#include "base/functional/bind.h"
|
||||
@@ -568,6 +569,15 @@ AutocompleteController::AutocompleteCont
|
||||
@@ -570,6 +571,15 @@ AutocompleteController::AutocompleteCont
|
||||
steady_state_omnibox_position_(
|
||||
metrics::OmniboxEventProto::UNKNOWN_POSITION) {
|
||||
provider_types &= ~OmniboxFieldTrial::GetDisabledProviderTypes();
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "base/debug/alias.h"
|
||||
#include "base/functional/bind.h"
|
||||
#include "base/i18n/rtl.h"
|
||||
@@ -754,6 +755,13 @@ void Tab::HideHover(TabStyle::HideHoverS
|
||||
@@ -761,6 +762,13 @@ void Tab::HideHover(TabStyle::HideHoverS
|
||||
DeprecatedLayoutImmediately();
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
base::FeatureList::IsEnabled(
|
||||
--- a/chrome/browser/ui/views/frame/browser_view.cc
|
||||
+++ b/chrome/browser/ui/views/frame/browser_view.cc
|
||||
@@ -5148,6 +5148,7 @@ void BrowserView::AddedToWidget() {
|
||||
@@ -5159,6 +5159,7 @@ void BrowserView::AddedToWidget() {
|
||||
|
||||
toolbar_->Init();
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/browser/ui/views/tabs/tab.cc
|
||||
+++ b/chrome/browser/ui/views/tabs/tab.cc
|
||||
@@ -1163,7 +1163,11 @@ void Tab::UpdateIconVisibility() {
|
||||
@@ -1170,7 +1170,11 @@ void Tab::UpdateIconVisibility() {
|
||||
// Close button is shown on active tabs regardless of the size.
|
||||
showing_close_button_ = true;
|
||||
#endif // BUILDFLAG(IS_CHROMEOS)
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
showing_alert_indicator_ =
|
||||
has_alert_icon && alert_icon_width <= available_width;
|
||||
@@ -1192,6 +1196,8 @@ void Tab::UpdateIconVisibility() {
|
||||
@@ -1199,6 +1203,8 @@ void Tab::UpdateIconVisibility() {
|
||||
!controller_->IsLockedForOnTask() &&
|
||||
#endif
|
||||
large_enough_for_close_button;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -4929,10 +4929,12 @@ constexpr char kWebiumFlag[] = "webium";
|
||||
@@ -4930,10 +4930,12 @@ constexpr char kWebiumFlag[] = "webium";
|
||||
#include "chrome/browser/ungoogled_flag_choices.h"
|
||||
#include "chrome/browser/bromite_flag_choices.h"
|
||||
#include "chrome/browser/ungoogled_platform_flag_choices.h"
|
||||
|
||||
@@ -196,7 +196,7 @@
|
||||
// already owned by the TemplateURLService.
|
||||
--- a/chrome/browser/ui/search_engines/keyword_editor_controller.cc
|
||||
+++ b/chrome/browser/ui/search_engines/keyword_editor_controller.cc
|
||||
@@ -27,23 +27,27 @@ KeywordEditorController::KeywordEditorCo
|
||||
@@ -28,23 +28,27 @@ KeywordEditorController::KeywordEditorCo
|
||||
|
||||
KeywordEditorController::~KeywordEditorController() = default;
|
||||
|
||||
@@ -232,7 +232,7 @@
|
||||
DCHECK(!url.empty());
|
||||
const std::optional<size_t> index =
|
||||
table_model_->IndexOfTemplateURL(template_url);
|
||||
@@ -55,11 +59,13 @@ void KeywordEditorController::ModifyTemp
|
||||
@@ -56,11 +60,13 @@ void KeywordEditorController::ModifyTemp
|
||||
|
||||
// Don't do anything if the entry didn't change.
|
||||
if ((template_url->short_name() == title) &&
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -4925,7 +4925,13 @@ constexpr char kWebiumFlag[] = "webium";
|
||||
@@ -4926,7 +4926,13 @@ constexpr char kWebiumFlag[] = "webium";
|
||||
// calculate and verify checksum.
|
||||
//
|
||||
// When adding a new choice, add it to the end of the list.
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
--- a/components/omnibox/browser/featured_search_provider.cc
|
||||
+++ b/components/omnibox/browser/featured_search_provider.cc
|
||||
@@ -290,20 +290,10 @@ void FeaturedSearchProvider::AddFeatured
|
||||
@@ -290,21 +290,10 @@ void FeaturedSearchProvider::AddFeatured
|
||||
for (TemplateURL* turl : turls) {
|
||||
if (turl->starter_pack_id() > 0 &&
|
||||
turl->is_active() == TemplateURLData::ActiveStatus::kTrue) {
|
||||
@@ -47,6 +47,7 @@
|
||||
- // Skip @aimode if feature disabled.
|
||||
- if (turl->starter_pack_id() == template_url_starter_pack_data::kAiMode &&
|
||||
- (!omnibox_feature_configs::Toolbelt::Get().enabled ||
|
||||
- !client_->GetAimEligibilityService() ||
|
||||
- !client_->GetAimEligibilityService()->IsAimEligible())) {
|
||||
+ // Disable all Google AI starter pack options
|
||||
+ if (turl->starter_pack_id() == template_url_starter_pack_data::kGemini ||
|
||||
|
||||
@@ -0,0 +1,238 @@
|
||||
--- a/extensions/common/extension_l10n_util.h
|
||||
+++ b/extensions/common/extension_l10n_util.h
|
||||
@@ -81,7 +81,8 @@ bool LocalizeManifest(const extensions::
|
||||
bool LocalizeExtension(const base::FilePath& extension_path,
|
||||
base::Value::Dict* manifest,
|
||||
GzippedMessagesPermission gzip_permission,
|
||||
- std::string* error);
|
||||
+ std::string* error,
|
||||
+ bool is_component = false);
|
||||
|
||||
// Adds locale_name to the extension if it's in chrome_locales, and
|
||||
// if messages file is present (we don't check content of messages file here).
|
||||
@@ -129,6 +130,11 @@ extensions::MessageBundle* LoadMessageCa
|
||||
GzippedMessagesPermission gzip_permission,
|
||||
std::string* error);
|
||||
|
||||
+extensions::MessageBundle* LoadComponentMessageCatalogs(
|
||||
+ const base::FilePath& extension_root,
|
||||
+ const std::string& default_locale,
|
||||
+ std::string* error);
|
||||
+
|
||||
// Loads message catalogs for all locales to check for validity. Used for
|
||||
// validating unpacked extensions.
|
||||
bool ValidateExtensionLocales(const base::FilePath& extension_path,
|
||||
--- a/extensions/common/extension_l10n_util.cc
|
||||
+++ b/extensions/common/extension_l10n_util.cc
|
||||
@@ -18,14 +18,18 @@
|
||||
#include "base/files/file_enumerator.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/json/json_file_value_serializer.h"
|
||||
+#include "base/json/json_string_value_serializer.h"
|
||||
#include "base/json/json_reader.h"
|
||||
#include "base/logging.h"
|
||||
+#include "base/memory/ref_counted_memory.h"
|
||||
#include "base/no_destructor.h"
|
||||
#include "base/strings/strcat.h"
|
||||
#include "base/strings/string_util.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/values.h"
|
||||
+#include "extensions/browser/component_extension_resource_manager.h"
|
||||
+#include "extensions/browser/extensions_browser_client.h"
|
||||
#include "extensions/common/constants.h"
|
||||
#include "extensions/common/error_utils.h"
|
||||
#include "extensions/common/extension.h"
|
||||
@@ -38,6 +42,7 @@
|
||||
#include "third_party/icu/source/common/unicode/uloc.h"
|
||||
#include "third_party/zlib/google/compression_utils.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
+#include "ui/base/resource/resource_bundle.h"
|
||||
|
||||
namespace errors = extensions::manifest_errors;
|
||||
namespace keys = extensions::manifest_keys;
|
||||
@@ -113,6 +118,19 @@ std::optional<base::Value::Dict> LoadMes
|
||||
return dictionary;
|
||||
}
|
||||
|
||||
+std::optional<base::Value::Dict> LoadMessageFile(
|
||||
+ int resource_id, std::string* error) {
|
||||
+ const ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
|
||||
+ JSONStringValueDeserializer messages_deserializer(
|
||||
+ base::as_string_view(*rb.LoadDataResourceBytes(resource_id)));
|
||||
+
|
||||
+ if (auto value = messages_deserializer.Deserialize(nullptr, error); value) {
|
||||
+ return std::move(*value).TakeDict();
|
||||
+ }
|
||||
+
|
||||
+ return std::nullopt;
|
||||
+}
|
||||
+
|
||||
// Localizes manifest value of string type for a given key.
|
||||
bool LocalizeManifestValue(const std::string& key,
|
||||
const extensions::MessageBundle& messages,
|
||||
@@ -360,13 +378,16 @@ bool LocalizeManifest(const extensions::
|
||||
bool LocalizeExtension(const base::FilePath& extension_path,
|
||||
base::Value::Dict* manifest,
|
||||
GzippedMessagesPermission gzip_permission,
|
||||
- std::string* error) {
|
||||
+ std::string* error,
|
||||
+ bool is_component) {
|
||||
DCHECK(manifest);
|
||||
|
||||
std::string default_locale = GetDefaultLocaleFromManifest(*manifest, error);
|
||||
|
||||
std::unique_ptr<extensions::MessageBundle> message_bundle(
|
||||
- extensions::file_util::LoadMessageBundle(extension_path, default_locale,
|
||||
+ is_component ? extensions::file_util::LoadComponentMessageBundle(extension_path,
|
||||
+ default_locale, error)
|
||||
+ : extensions::file_util::LoadMessageBundle(extension_path, default_locale,
|
||||
gzip_permission, error));
|
||||
|
||||
if (!message_bundle && !error->empty())
|
||||
@@ -504,6 +525,42 @@ extensions::MessageBundle* LoadMessageCa
|
||||
return extensions::MessageBundle::Create(catalogs, error);
|
||||
}
|
||||
|
||||
+extensions::MessageBundle* LoadComponentMessageCatalogs(
|
||||
+ const base::FilePath& extension_root,
|
||||
+ const std::string& default_locale,
|
||||
+ std::string* error) {
|
||||
+ std::vector<std::string> all_fallback_locales;
|
||||
+ base::FilePath locale_path(extensions::kLocaleFolder);
|
||||
+
|
||||
+ auto* manager =
|
||||
+ extensions::ExtensionsBrowserClient::Get()->GetComponentExtensionResourceManager();
|
||||
+
|
||||
+ GetAllFallbackLocales(default_locale, &all_fallback_locales);
|
||||
+
|
||||
+ extensions::MessageBundle::CatalogVector catalogs;
|
||||
+ for (const auto& fallback_locale : all_fallback_locales) {
|
||||
+ base::FilePath this_locale_path =
|
||||
+ locale_path.AppendASCII(fallback_locale)
|
||||
+ .AppendASCII(extensions::kMessagesFilename);
|
||||
+ int resource_id = 0;
|
||||
+
|
||||
+ if (!manager->IsComponentExtensionResource(
|
||||
+ extension_root, this_locale_path, &resource_id)) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ std::optional<base::Value::Dict> catalog = LoadMessageFile(resource_id, error);
|
||||
+ if (!catalog.has_value()) {
|
||||
+ return nullptr;
|
||||
+ }
|
||||
+
|
||||
+ catalogs.push_back(std::move(*catalog));
|
||||
+ }
|
||||
+
|
||||
+ return extensions::MessageBundle::Create(
|
||||
+ catalogs, error);
|
||||
+}
|
||||
+
|
||||
bool ValidateExtensionLocales(const base::FilePath& extension_path,
|
||||
const base::Value::Dict& manifest,
|
||||
std::string* error) {
|
||||
--- a/extensions/browser/l10n_file_util.h
|
||||
+++ b/extensions/browser/l10n_file_util.h
|
||||
@@ -47,7 +47,8 @@ LoadMessageBundleSubstitutionMapFromPath
|
||||
const std::vector<base::FilePath>& paths,
|
||||
const ExtensionId& extension_id,
|
||||
const std::string& default_locale,
|
||||
- extension_l10n_util::GzippedMessagesPermission gzip_permission);
|
||||
+ extension_l10n_util::GzippedMessagesPermission gzip_permission,
|
||||
+ bool is_component = false);
|
||||
|
||||
} // namespace extensions::l10n_file_util
|
||||
|
||||
--- a/extensions/browser/l10n_file_util.cc
|
||||
+++ b/extensions/browser/l10n_file_util.cc
|
||||
@@ -38,7 +38,8 @@ LoadMessageBundleSubstitutionMapFromPath
|
||||
const std::vector<base::FilePath>& paths,
|
||||
const ExtensionId& extension_id,
|
||||
const std::string& default_locale,
|
||||
- extension_l10n_util::GzippedMessagesPermission gzip_permission) {
|
||||
+ extension_l10n_util::GzippedMessagesPermission gzip_permission,
|
||||
+ bool is_component) {
|
||||
std::unique_ptr<MessageBundle::SubstitutionMap> return_value =
|
||||
LoadNonLocalizedMessageBundleSubstitutionMap(extension_id);
|
||||
|
||||
@@ -49,8 +50,13 @@ LoadMessageBundleSubstitutionMapFromPath
|
||||
|
||||
std::string error;
|
||||
for (const base::FilePath& path : paths) {
|
||||
- std::unique_ptr<MessageBundle> bundle(file_util::LoadMessageBundle(
|
||||
- path, default_locale, gzip_permission, &error));
|
||||
+ std::unique_ptr<MessageBundle> bundle(
|
||||
+ is_component
|
||||
+ ? file_util::LoadComponentMessageBundle(
|
||||
+ path, default_locale, &error)
|
||||
+ : file_util::LoadMessageBundle(
|
||||
+ path, default_locale, gzip_permission, &error));
|
||||
+
|
||||
if (bundle) {
|
||||
for (const auto& iter : *bundle->dictionary()) {
|
||||
// |insert| only adds new entries, and does not replace entries in
|
||||
--- a/extensions/common/file_util.h
|
||||
+++ b/extensions/common/file_util.h
|
||||
@@ -162,6 +162,11 @@ MessageBundle* LoadMessageBundle(
|
||||
extension_l10n_util::GzippedMessagesPermission gzip_permission,
|
||||
std::string* error);
|
||||
|
||||
+MessageBundle* LoadComponentMessageBundle(
|
||||
+ const base::FilePath& extension_root,
|
||||
+ const std::string& default_locale,
|
||||
+ std::string* error);
|
||||
+
|
||||
// Helper functions for getting paths for files used in content verification.
|
||||
base::FilePath GetVerifiedContentsPath(const base::FilePath& extension_path);
|
||||
base::FilePath GetComputedHashesPath(const base::FilePath& extension_path);
|
||||
--- a/extensions/common/file_util.cc
|
||||
+++ b/extensions/common/file_util.cc
|
||||
@@ -593,6 +593,25 @@ MessageBundle* LoadMessageBundle(
|
||||
return message_bundle;
|
||||
}
|
||||
|
||||
+MessageBundle* LoadComponentMessageBundle(
|
||||
+ const base::FilePath& extension_root,
|
||||
+ const std::string& default_locale,
|
||||
+ std::string* error) {
|
||||
+ error->clear();
|
||||
+
|
||||
+ std::set<std::string> chrome_locales;
|
||||
+ extension_l10n_util::GetAllLocales(&chrome_locales);
|
||||
+
|
||||
+ if (default_locale.empty() || !base::Contains(chrome_locales, default_locale)) {
|
||||
+ *error = l10n_util::GetStringUTF8(
|
||||
+ IDS_EXTENSION_LOCALES_NO_DEFAULT_LOCALE_SPECIFIED);
|
||||
+ return nullptr;
|
||||
+ }
|
||||
+
|
||||
+ return extension_l10n_util::LoadComponentMessageCatalogs(
|
||||
+ extension_root, default_locale, error);
|
||||
+}
|
||||
+
|
||||
base::FilePath GetVerifiedContentsPath(const base::FilePath& extension_path) {
|
||||
return extension_path.Append(kMetadataFolder)
|
||||
.Append(kVerifiedContentsFilename);
|
||||
--- a/extensions/browser/renderer_startup_helper.cc
|
||||
+++ b/extensions/browser/renderer_startup_helper.cc
|
||||
@@ -608,6 +608,18 @@ void RendererStartupHelper::GetMessageBu
|
||||
paths_to_load.push_back(imported_extension->path());
|
||||
}
|
||||
|
||||
+ bool is_component =
|
||||
+ extension->location() == extensions::mojom::ManifestLocation::kComponent;
|
||||
+
|
||||
+ if (is_component) {
|
||||
+ auto dictionary_map = l10n_file_util::LoadMessageBundleSubstitutionMapFromPaths(
|
||||
+ paths_to_load, extension_id, default_locale,
|
||||
+ extension_l10n_util::GzippedMessagesPermission::kAllowForTrustedSource,
|
||||
+ is_component);
|
||||
+ std::move(callback).Run(ToFlatMap(*dictionary_map));
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
// This blocks tab loading. Priority is inherited from the calling context.
|
||||
base::ThreadPool::PostTaskAndReplyWithResult(
|
||||
FROM_HERE, {base::MayBlock()},
|
||||
@@ -138,7 +138,7 @@ TODO: guard services_page.html with is_mac
|
||||
+++ b/chrome/app/settings_strings.grdp
|
||||
@@ -1951,6 +1951,12 @@
|
||||
<message name="IDS_SETTINGS_HELIUM_SERVICES_SPELLCHECK_TOGGLE_DESCRIPTION" desc="Description of the for enabling/disabling of downloading spellcheck files">
|
||||
When enabled, Helium will fetch dictionary files used for spell checking when requested.
|
||||
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
|
||||
|
||||
@@ -0,0 +1,496 @@
|
||||
--- a/chrome/browser/importer/external_process_importer_host.cc
|
||||
+++ b/chrome/browser/importer/external_process_importer_host.cc
|
||||
@@ -133,7 +133,7 @@ void ExternalProcessImporterHost::OnTemp
|
||||
void ExternalProcessImporterHost::ShowWarningDialog() {
|
||||
DCHECK(!headless_);
|
||||
importer::ShowImportLockDialog(
|
||||
- parent_window_,
|
||||
+ parent_view_, parent_window_,
|
||||
base::BindOnce(&ExternalProcessImporterHost::OnImportLockDialogEnd,
|
||||
weak_ptr_factory_.GetWeakPtr()));
|
||||
}
|
||||
@@ -157,7 +157,8 @@ void ExternalProcessImporterHost::OnImpo
|
||||
|
||||
bool ExternalProcessImporterHost::CheckForFirefoxLock(
|
||||
const user_data_importer::SourceProfile& source_profile) {
|
||||
- if (source_profile.importer_type != user_data_importer::TYPE_FIREFOX) {
|
||||
+ if (source_profile.importer_type != user_data_importer::TYPE_FIREFOX
|
||||
+ && source_profile.importer_type != user_data_importer::TYPE_ZEN) {
|
||||
return true;
|
||||
}
|
||||
|
||||
--- a/chrome/browser/importer/importer_list.cc
|
||||
+++ b/chrome/browser/importer/importer_list.cc
|
||||
@@ -92,6 +92,51 @@ void DetectSafariProfiles(
|
||||
}
|
||||
#endif // BUILDFLAG(IS_MAC)
|
||||
|
||||
+void DetectZenProfiles(
|
||||
+ const std::string locale,
|
||||
+ std::vector<user_data_importer::SourceProfile>* profiles) {
|
||||
+ base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
|
||||
+ base::BlockingType::MAY_BLOCK);
|
||||
+#if BUILDFLAG(IS_WIN)
|
||||
+ // zen uses the same prefix as firefox, which is very convenient for us
|
||||
+ const std::string zen_install_id =
|
||||
+ shell_integration::GetFirefoxProgIdSuffix();
|
||||
+#else
|
||||
+ const std::string zen_install_id;
|
||||
+#endif // BUILDFLAG(IS_WIN)
|
||||
+ std::vector<FirefoxDetail> details = GetZenDetails(zen_install_id);
|
||||
+
|
||||
+ for (const auto& detail : details) {
|
||||
+ base::FilePath app_path;
|
||||
+ if (detail.path.empty())
|
||||
+ continue;
|
||||
+
|
||||
+ int version;
|
||||
+ GetFirefoxVersionAndPathFromProfile(detail.path, &version, &app_path);
|
||||
+
|
||||
+ user_data_importer::SourceProfile zen;
|
||||
+ zen.importer_name = u"Zen";
|
||||
+ zen.profile = detail.name;
|
||||
+ zen.importer_type = user_data_importer::TYPE_ZEN;
|
||||
+ zen.source_path = detail.path;
|
||||
+#if BUILDFLAG(IS_WIN)
|
||||
+ zen.app_path = GetFirefoxInstallPathFromRegistry();
|
||||
+#endif
|
||||
+ if (zen.app_path.empty()) {
|
||||
+ if (app_path.empty()) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ zen.app_path = app_path;
|
||||
+ }
|
||||
+
|
||||
+ zen.services_supported = user_data_importer::HISTORY
|
||||
+ | user_data_importer::FAVORITES;
|
||||
+ zen.locale = locale;
|
||||
+ profiles->push_back(zen);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
// |locale|: The application locale used for lookups in Firefox's
|
||||
// locale-specific search engines feature (see firefox_importer.cc for
|
||||
// details).
|
||||
@@ -157,6 +202,8 @@ void DetectFirefoxProfiles(
|
||||
firefox.locale = locale;
|
||||
profiles->push_back(firefox);
|
||||
}
|
||||
+
|
||||
+ DetectZenProfiles(locale, profiles);
|
||||
}
|
||||
|
||||
std::vector<user_data_importer::SourceProfile> DetectSourceProfilesWorker(
|
||||
--- a/chrome/common/importer/firefox_importer_utils_linux.cc
|
||||
+++ b/chrome/common/importer/firefox_importer_utils_linux.cc
|
||||
@@ -9,17 +9,26 @@
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/path_service.h"
|
||||
|
||||
-base::FilePath GetProfilesINI() {
|
||||
+base::FilePath _GetProfilesINI(const char* folder) {
|
||||
base::FilePath ini_file;
|
||||
// The default location of the profile folder containing user data is
|
||||
// under user HOME directory in .mozilla/firefox folder on Linux.
|
||||
base::FilePath home;
|
||||
base::PathService::Get(base::DIR_HOME, &home);
|
||||
if (!home.empty()) {
|
||||
- ini_file = home.Append(".mozilla/firefox/profiles.ini");
|
||||
+ ini_file = home.Append(folder)
|
||||
+ .Append("profiles.ini");
|
||||
}
|
||||
if (base::PathExists(ini_file))
|
||||
return ini_file;
|
||||
|
||||
return base::FilePath();
|
||||
}
|
||||
+
|
||||
+base::FilePath GetProfilesINI() {
|
||||
+ return _GetProfilesINI(".mozilla/firefox");
|
||||
+}
|
||||
+
|
||||
+base::FilePath GetZenProfilesINI() {
|
||||
+ return _GetProfilesINI(".zen");
|
||||
+}
|
||||
--- a/chrome/common/importer/firefox_importer_utils_mac.mm
|
||||
+++ b/chrome/common/importer/firefox_importer_utils_mac.mm
|
||||
@@ -7,15 +7,23 @@
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/path_service.h"
|
||||
|
||||
-base::FilePath GetProfilesINI() {
|
||||
+base::FilePath _GetProfilesINI(const char* folder) {
|
||||
base::FilePath app_data_path;
|
||||
if (!base::PathService::Get(base::DIR_APP_DATA, &app_data_path)) {
|
||||
return base::FilePath();
|
||||
}
|
||||
base::FilePath ini_file =
|
||||
- app_data_path.Append("Firefox").Append("profiles.ini");
|
||||
+ app_data_path.Append(folder).Append("profiles.ini");
|
||||
if (!base::PathExists(ini_file)) {
|
||||
return base::FilePath();
|
||||
}
|
||||
return ini_file;
|
||||
}
|
||||
+
|
||||
+base::FilePath GetProfilesINI() {
|
||||
+ return _GetProfilesINI("Firefox");
|
||||
+}
|
||||
+
|
||||
+base::FilePath GetZenProfilesINI() {
|
||||
+ return _GetProfilesINI("zen");
|
||||
+}
|
||||
--- a/chrome/common/importer/firefox_importer_utils_win.cc
|
||||
+++ b/chrome/common/importer/firefox_importer_utils_win.cc
|
||||
@@ -68,16 +68,23 @@ base::FilePath GetFirefoxInstallPathFrom
|
||||
return (result != ERROR_SUCCESS) ? base::FilePath() : base::FilePath(buffer);
|
||||
}
|
||||
|
||||
-base::FilePath GetProfilesINI() {
|
||||
+base::FilePath _GetProfilesINI(const char* folder) {
|
||||
base::FilePath ini_file;
|
||||
// The default location of the profile folder containing user data is
|
||||
// under the "Application Data" folder in Windows XP, Vista, and 7.
|
||||
if (!base::PathService::Get(base::DIR_ROAMING_APP_DATA, &ini_file))
|
||||
return base::FilePath();
|
||||
|
||||
- ini_file = ini_file.AppendASCII("Mozilla");
|
||||
- ini_file = ini_file.AppendASCII("Firefox");
|
||||
+ ini_file = ini_file.AppendASCII(folder);
|
||||
ini_file = ini_file.AppendASCII("profiles.ini");
|
||||
|
||||
return base::PathExists(ini_file) ? ini_file : base::FilePath();
|
||||
}
|
||||
+
|
||||
+base::FilePath GetProfilesINI() {
|
||||
+ return _GetProfilesINI("Mozilla\\Firefox");
|
||||
+}
|
||||
+
|
||||
+base::FilePath GetZenProfilesINI() {
|
||||
+ return _GetProfilesINI("zen");
|
||||
+}
|
||||
--- a/chrome/common/importer/firefox_importer_utils.cc
|
||||
+++ b/chrome/common/importer/firefox_importer_utils.cc
|
||||
@@ -29,7 +29,8 @@ namespace {
|
||||
|
||||
// Retrieves the file system path of the profile name.
|
||||
base::FilePath GetProfilePath(const base::Value::Dict& root,
|
||||
- const std::string& profile_name) {
|
||||
+ const std::string& profile_name,
|
||||
+ const base::FilePath& base_dir) {
|
||||
std::string path_str;
|
||||
const std::string* is_relative =
|
||||
root.FindStringByDottedPath(profile_name + ".IsRelative");
|
||||
@@ -50,26 +51,41 @@ base::FilePath GetProfilePath(const base
|
||||
// path of profiles.ini. IsRelative=0 refers to a custom profile
|
||||
// location.
|
||||
if (*is_relative == "1")
|
||||
- path = GetProfilesINI().DirName().Append(path);
|
||||
+ path = base_dir.Append(path);
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
-std::vector<FirefoxDetail> GetFirefoxDetails(
|
||||
- const std::string& firefox_install_id) {
|
||||
- base::FilePath ini_file = GetProfilesINI();
|
||||
+std::vector<FirefoxDetail> _GetFirefoxDetails(
|
||||
+ const std::string& firefox_install_id,
|
||||
+ base::FilePath ini_file) {
|
||||
std::string content;
|
||||
base::ReadFileToString(ini_file, &content);
|
||||
DictionaryValueINIParser ini_parser;
|
||||
ini_parser.Parse(content);
|
||||
- return GetFirefoxDetailsFromDictionary(ini_parser.root(), firefox_install_id);
|
||||
+ return GetFirefoxDetailsFromDictionary(
|
||||
+ ini_parser.root(), firefox_install_id, ini_file.DirName());
|
||||
+}
|
||||
+
|
||||
+std::vector<FirefoxDetail> GetFirefoxDetails(
|
||||
+ const std::string& firefox_install_id) {
|
||||
+ base::FilePath ini_file = GetProfilesINI();
|
||||
+ return _GetFirefoxDetails(firefox_install_id, ini_file);
|
||||
+}
|
||||
+
|
||||
+std::vector<FirefoxDetail> GetZenDetails(
|
||||
+ const std::string& zen_install_id) {
|
||||
+ base::FilePath ini_file = GetZenProfilesINI();
|
||||
+ return _GetFirefoxDetails(zen_install_id, ini_file);
|
||||
}
|
||||
|
||||
+
|
||||
std::vector<FirefoxDetail> GetFirefoxDetailsFromDictionary(
|
||||
const base::Value::Dict& root,
|
||||
- const std::string& firefox_install_id) {
|
||||
+ const std::string& firefox_install_id,
|
||||
+ const base::FilePath& base_dir) {
|
||||
std::vector<FirefoxDetail> profile_details;
|
||||
|
||||
for (int i = 0; ; ++i) {
|
||||
@@ -84,7 +100,7 @@ std::vector<FirefoxDetail> GetFirefoxDet
|
||||
continue;
|
||||
|
||||
FirefoxDetail details;
|
||||
- details.path = GetProfilePath(root, current_profile);
|
||||
+ details.path = GetProfilePath(root, current_profile, base_dir);
|
||||
std::u16string name;
|
||||
if (const std::string* name_utf8 =
|
||||
root.FindStringByDottedPath(current_profile + ".Name")) {
|
||||
--- a/chrome/common/importer/firefox_importer_utils.h
|
||||
+++ b/chrome/common/importer/firefox_importer_utils.h
|
||||
@@ -45,13 +45,17 @@ struct FirefoxDetail {
|
||||
std::vector<FirefoxDetail> GetFirefoxDetails(
|
||||
const std::string& firefox_install_id);
|
||||
|
||||
+std::vector<FirefoxDetail> GetZenDetails(
|
||||
+ const std::string& zen_install_id);
|
||||
+
|
||||
// Returns the path to the Firefox profile, using a custom dictionary.
|
||||
// If |firefox_install_id| is not empty returns the default profile associated
|
||||
// with that id.
|
||||
// Exposed for testing.
|
||||
std::vector<FirefoxDetail> GetFirefoxDetailsFromDictionary(
|
||||
const base::Value::Dict& root,
|
||||
- const std::string& firefox_install_id);
|
||||
+ const std::string& firefox_install_id,
|
||||
+ const base::FilePath& base_dir);
|
||||
|
||||
// Detects version of Firefox and installation path for the given Firefox
|
||||
// profile.
|
||||
@@ -62,6 +66,7 @@ bool GetFirefoxVersionAndPathFromProfile
|
||||
// Gets the full path of the profiles.ini file. This file records the profiles
|
||||
// that can be used by Firefox. Returns an empty path if failed.
|
||||
base::FilePath GetProfilesINI();
|
||||
+base::FilePath GetZenProfilesINI();
|
||||
|
||||
// Returns the home page set in Firefox in a particular profile.
|
||||
GURL GetHomepage(const base::FilePath& profile_path);
|
||||
--- a/chrome/utility/importer/importer_creator.cc
|
||||
+++ b/chrome/utility/importer/importer_creator.cc
|
||||
@@ -38,6 +38,7 @@ scoped_refptr<Importer> CreateImporterBy
|
||||
return new BookmarksFileImporter();
|
||||
#if !BUILDFLAG(IS_CHROMEOS)
|
||||
case user_data_importer::TYPE_FIREFOX:
|
||||
+ case user_data_importer::TYPE_ZEN:
|
||||
return new FirefoxImporter();
|
||||
#endif
|
||||
#if BUILDFLAG(IS_MAC)
|
||||
--- a/components/user_data_importer/common/importer_type.h
|
||||
+++ b/components/user_data_importer/common/importer_type.h
|
||||
@@ -38,6 +38,7 @@ enum ImporterType {
|
||||
TYPE_BRAVE = 71,
|
||||
TYPE_DIA = 72,
|
||||
TYPE_PERPLEXITY_COMET = 73,
|
||||
+ TYPE_ZEN = 74,
|
||||
};
|
||||
|
||||
} // namespace user_data_importer
|
||||
--- a/chrome/browser/ui/webui/settings/import_data_handler.cc
|
||||
+++ b/chrome/browser/ui/webui/settings/import_data_handler.cc
|
||||
@@ -106,6 +106,12 @@ void ImportDataHandler::StartImport(
|
||||
importer_host_ = new ExternalProcessImporterHost();
|
||||
importer_host_->set_observer(this);
|
||||
Profile* profile = Profile::FromWebUI(web_ui());
|
||||
+
|
||||
+ importer_host_->set_parent_window(
|
||||
+ web_ui()->GetWebContents()->GetTopLevelNativeWindow());
|
||||
+ importer_host_->set_parent_view(
|
||||
+ web_ui()->GetWebContents()->GetNativeView());
|
||||
+
|
||||
importer_host_->StartImportSettings(source_profile, profile, imported_items,
|
||||
new ProfileWriter(profile));
|
||||
|
||||
--- a/chrome/utility/importer/firefox_importer.cc
|
||||
+++ b/chrome/utility/importer/firefox_importer.cc
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "components/user_data_importer/utility/bookmark_parser.h"
|
||||
#include "sql/database.h"
|
||||
#include "sql/statement.h"
|
||||
+#include "ui/base/l10n/l10n_util.h"
|
||||
#include "url/gurl.h"
|
||||
|
||||
#if !BUILDFLAG(IS_MAC)
|
||||
@@ -115,6 +116,7 @@ void FirefoxImporter::StartImport(
|
||||
bridge_ = bridge;
|
||||
source_path_ = source_profile.source_path;
|
||||
app_path_ = source_profile.app_path;
|
||||
+ browser_name_ = source_profile.importer_name;
|
||||
|
||||
#if BUILDFLAG(IS_POSIX)
|
||||
locale_ = source_profile.locale;
|
||||
@@ -375,10 +377,12 @@ void FirefoxImporter::ImportBookmarks()
|
||||
}
|
||||
}
|
||||
|
||||
+ ImportZenPins(db, bookmarks);
|
||||
+
|
||||
// Write into profile.
|
||||
if (!bookmarks.empty() && !cancelled()) {
|
||||
- const std::u16string& first_folder_name =
|
||||
- bridge_->GetLocalizedString(IDS_BOOKMARK_GROUP_FROM_FIREFOX);
|
||||
+ std::u16string first_folder_name = l10n_util::GetStringFUTF16(
|
||||
+ IDS_IMPORTED_FROM_BOOKMARK_FOLDER, browser_name_);
|
||||
bridge_->AddBookmarks(bookmarks, first_folder_name);
|
||||
}
|
||||
if (!search_engines.empty() && !cancelled()) {
|
||||
@@ -399,6 +403,81 @@ void FirefoxImporter::ImportBookmarks()
|
||||
}
|
||||
}
|
||||
|
||||
+constexpr char kZenPinQuery[] = "SELECT uuid, title, url, is_group, created_at, "
|
||||
+ " is_essential, folder_parent_uuid FROM zen_pins";
|
||||
+
|
||||
+using user_data_importer::ImportedBookmarkEntry;
|
||||
+void FirefoxImporter::ImportZenPins(sql::Database& db,
|
||||
+ std::vector<ImportedBookmarkEntry>& bookmarks_out) {
|
||||
+ sql::Statement s(db.GetUniqueStatement(kZenPinQuery));
|
||||
+
|
||||
+ if (!s.is_valid()) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ std::map<std::string, std::string> parents;
|
||||
+ std::map<std::string, ImportedBookmarkEntry> entries;
|
||||
+
|
||||
+ // first, we need to pull out all pins from the DB
|
||||
+ while (s.Step() && !cancelled()) {
|
||||
+ bool is_folder = s.ColumnBool(3); /* is_group */
|
||||
+
|
||||
+ std::string uuid = s.ColumnString(0); /* uuid */
|
||||
+ std::string parent = s.ColumnString(6); /* folder_parent_uuid */
|
||||
+
|
||||
+ if (!parent.empty()) {
|
||||
+ parents[uuid] = std::move(parent);
|
||||
+ }
|
||||
+
|
||||
+ ImportedBookmarkEntry entry;
|
||||
+ entry.creation_time = base::Time::FromTimeT(
|
||||
+ s.ColumnInt64(4) / 1000); /* created_at */
|
||||
+
|
||||
+ entry.title = s.ColumnString16(1); /* title */
|
||||
+ if (entry.title.ends_with(u'/')) {
|
||||
+ entry.title = u"";
|
||||
+ }
|
||||
+
|
||||
+ entry.url = GURL(s.ColumnStringView(2)); /* url */
|
||||
+ entry.path = {};
|
||||
+ entry.in_toolbar = s.ColumnBool(5); /* is_essential */
|
||||
+ entry.is_folder = is_folder;
|
||||
+
|
||||
+ entries[uuid] = std::move(entry);
|
||||
+ }
|
||||
+
|
||||
+ // compute the folder hierarchy
|
||||
+ for (auto& [ uuid, entry ] : entries) {
|
||||
+ std::vector<std::u16string> path;
|
||||
+ std::string current = uuid;
|
||||
+
|
||||
+ while (true) {
|
||||
+ auto query = parents.find(current);
|
||||
+
|
||||
+ if (query == parents.end()) {
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ current = query->second;
|
||||
+ path.insert(path.begin(),
|
||||
+ entries.find(current)->second.title);
|
||||
+ }
|
||||
+
|
||||
+ entry.path = std::move(path);
|
||||
+
|
||||
+ // Folders are ad-hoc constructed based on the .path
|
||||
+ // attribute that we defined just before this.
|
||||
+ // `is_folder` makes empty folders, which we don't
|
||||
+ // really care about when importing pins.
|
||||
+ // If you use empty folders for something, sorry I guess?
|
||||
+ if (entry.is_folder) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ bookmarks_out.push_back(std::move(entry));
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
#if !BUILDFLAG(IS_MAC)
|
||||
void FirefoxImporter::ImportPasswords() {
|
||||
// Initializes NSS3.
|
||||
--- a/chrome/utility/importer/firefox_importer.h
|
||||
+++ b/chrome/utility/importer/firefox_importer.h
|
||||
@@ -63,6 +63,8 @@ class FirefoxImporter : public Importer
|
||||
FRIEND_TEST_ALL_PREFIXES(FirefoxImporterTest, ImportBookmarksV25);
|
||||
|
||||
void ImportBookmarks();
|
||||
+ void ImportZenPins(sql::Database& db,
|
||||
+ std::vector<user_data_importer::ImportedBookmarkEntry>& bookmarks_out);
|
||||
|
||||
#if !BUILDFLAG(IS_MAC)
|
||||
void ImportPasswords();
|
||||
@@ -125,6 +127,8 @@ class FirefoxImporter : public Importer
|
||||
std::string locale_;
|
||||
#endif
|
||||
|
||||
+ std::u16string browser_name_;
|
||||
+
|
||||
base::WeakPtrFactory<FirefoxImporter> weak_ptr_factory_{this};
|
||||
};
|
||||
|
||||
--- a/chrome/browser/importer/importer_lock_dialog.h
|
||||
+++ b/chrome/browser/importer/importer_lock_dialog.h
|
||||
@@ -19,13 +19,13 @@ namespace importer {
|
||||
// with the message either to skip the import, or to continue the process.
|
||||
void ShowImportLockDialog(gfx::NativeWindow parent,
|
||||
base::OnceCallback<void(bool)> callback,
|
||||
- int importer_lock_title_id = IDS_IMPORTER_LOCK_TITLE,
|
||||
- int importer_lock_text_id = IDS_IMPORTER_LOCK_TEXT);
|
||||
+ int importer_lock_title_id = IDS_EXTENSIONS_IMPORTER_LOCK_TITLE,
|
||||
+ int importer_lock_text_id = IDS_EXTENSIONS_IMPORTER_LOCK_TEXT);
|
||||
void ShowImportLockDialog(gfx::NativeView parent_view,
|
||||
gfx::NativeWindow parent,
|
||||
base::OnceCallback<void(bool)> callback,
|
||||
- int importer_lock_title_id = IDS_IMPORTER_LOCK_TITLE,
|
||||
- int importer_lock_text_id = IDS_IMPORTER_LOCK_TEXT);
|
||||
+ int importer_lock_title_id = IDS_EXTENSIONS_IMPORTER_LOCK_TITLE,
|
||||
+ int importer_lock_text_id = IDS_EXTENSIONS_IMPORTER_LOCK_TEXT);
|
||||
|
||||
} // namespace importer
|
||||
|
||||
--- a/chrome/browser/ui/views/importer/import_lock_dialog_view.h
|
||||
+++ b/chrome/browser/ui/views/importer/import_lock_dialog_view.h
|
||||
@@ -21,13 +21,13 @@ class ImportLockDialogView : public view
|
||||
|
||||
static void Show(gfx::NativeWindow parent,
|
||||
base::OnceCallback<void(bool)> callback,
|
||||
- int importer_lock_title_id = IDS_IMPORTER_LOCK_TITLE,
|
||||
- int importer_lock_text_id = IDS_IMPORTER_LOCK_TEXT);
|
||||
+ int importer_lock_title_id = IDS_EXTENSIONS_IMPORTER_LOCK_TITLE,
|
||||
+ int importer_lock_text_id = IDS_EXTENSIONS_IMPORTER_LOCK_TEXT);
|
||||
static void Show(gfx::NativeView parent_view,
|
||||
gfx::NativeWindow parent,
|
||||
base::OnceCallback<void(bool)> callback,
|
||||
- int importer_lock_title_id = IDS_IMPORTER_LOCK_TITLE,
|
||||
- int importer_lock_text_id = IDS_IMPORTER_LOCK_TEXT);
|
||||
+ int importer_lock_title_id = IDS_EXTENSIONS_IMPORTER_LOCK_TITLE,
|
||||
+ int importer_lock_text_id = IDS_EXTENSIONS_IMPORTER_LOCK_TEXT);
|
||||
ui::mojom::ModalType GetModalType() const override;
|
||||
|
||||
private:
|
||||
--- a/chrome/common/importer/profile_import_process_param_traits_macros.h
|
||||
+++ b/chrome/common/importer/profile_import_process_param_traits_macros.h
|
||||
@@ -20,11 +20,11 @@
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
IPC_ENUM_TRAITS_MIN_MAX_VALUE(user_data_importer::ImporterType,
|
||||
user_data_importer::TYPE_UNKNOWN,
|
||||
- user_data_importer::TYPE_PERPLEXITY_COMET)
|
||||
+ user_data_importer::TYPE_ZEN)
|
||||
#else
|
||||
IPC_ENUM_TRAITS_MIN_MAX_VALUE(user_data_importer::ImporterType,
|
||||
user_data_importer::TYPE_UNKNOWN,
|
||||
- user_data_importer::TYPE_PERPLEXITY_COMET)
|
||||
+ user_data_importer::TYPE_ZEN)
|
||||
#endif
|
||||
|
||||
IPC_ENUM_TRAITS_MIN_MAX_VALUE(user_data_importer::ImportItem,
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/browser/renderer_context_menu/render_view_context_menu.cc
|
||||
+++ b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
|
||||
@@ -2153,7 +2153,6 @@ void RenderViewContextMenu::AppendPageIt
|
||||
@@ -2157,7 +2157,6 @@ void RenderViewContextMenu::AppendPageIt
|
||||
IDS_CONTENT_CONTEXT_SAVEPAGEAS);
|
||||
menu_model_.AddItemWithStringId(IDC_PRINT, IDS_CONTENT_CONTEXT_PRINT);
|
||||
AppendLiveCaptionItem();
|
||||
@@ -8,7 +8,7 @@
|
||||
if (IsRegionSearchEnabled()) {
|
||||
AppendRegionSearchItem();
|
||||
}
|
||||
@@ -2282,8 +2281,7 @@ void RenderViewContextMenu::AppendMediaR
|
||||
@@ -2286,8 +2285,7 @@ void RenderViewContextMenu::AppendMediaR
|
||||
|
||||
void RenderViewContextMenu::AppendReadingModeItem() {
|
||||
// Show Read Anything option if it's not already open in the side panel.
|
||||
@@ -18,7 +18,7 @@
|
||||
menu_model_.AddItemWithStringId(IDC_CONTENT_CONTEXT_OPEN_IN_READING_MODE,
|
||||
IDS_CONTENT_CONTEXT_READING_MODE);
|
||||
}
|
||||
@@ -3550,10 +3548,12 @@ void RenderViewContextMenu::ExecuteComma
|
||||
@@ -3554,10 +3552,12 @@ void RenderViewContextMenu::ExecuteComma
|
||||
}
|
||||
|
||||
void RenderViewContextMenu::AddSpellCheckServiceItem(bool is_checked) {
|
||||
@@ -31,7 +31,7 @@
|
||||
if (is_checked) {
|
||||
menu_model_.AddCheckItemWithStringId(
|
||||
IDC_CONTENT_CONTEXT_ACCESSIBILITY_LABELS_TOGGLE,
|
||||
@@ -3930,6 +3930,8 @@ bool RenderViewContextMenu::IsVideoFrame
|
||||
@@ -3934,6 +3934,8 @@ bool RenderViewContextMenu::IsVideoFrame
|
||||
bool RenderViewContextMenu::AppendQRCodeGeneratorItem(bool for_image,
|
||||
bool draw_icon,
|
||||
bool add_separator) {
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
--- a/chrome/browser/importer/importer_list.cc
|
||||
+++ b/chrome/browser/importer/importer_list.cc
|
||||
@@ -254,6 +254,11 @@ std::vector<user_data_importer::SourcePr
|
||||
profiles.push_back(bookmarks_profile);
|
||||
}
|
||||
|
||||
+ for (auto& profile : profiles) {
|
||||
+ profile.services_supported &= ~(user_data_importer::PASSWORDS
|
||||
+ | user_data_importer::AUTOFILL_FORM_DATA);
|
||||
+ }
|
||||
+
|
||||
return profiles;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/chrome/browser/about_flags.cc
|
||||
+++ b/chrome/browser/about_flags.cc
|
||||
@@ -4926,11 +4926,13 @@ constexpr char kWebiumFlag[] = "webium";
|
||||
@@ -4927,11 +4927,13 @@ constexpr char kWebiumFlag[] = "webium";
|
||||
// calculate and verify checksum.
|
||||
//
|
||||
// When adding a new choice, add it to the end of the list.
|
||||
|
||||
@@ -32,6 +32,24 @@
|
||||
|
||||
html_source->AddLocalizedString(
|
||||
"saveGuestChoiceText", IDS_SEARCH_ENGINE_CHOICE_GUEST_SESSION_CHECKBOX);
|
||||
--- a/components/regional_capabilities/regional_capabilities_service.cc
|
||||
+++ b/components/regional_capabilities/regional_capabilities_service.cc
|
||||
@@ -164,6 +164,7 @@ std::pair<CountryId, LoadedCountrySource
|
||||
}
|
||||
|
||||
const ProgramSettings* CountryIdToProgram(CountryId country_id) {
|
||||
+ return &kWaffleSettings;
|
||||
#if BUILDFLAG(IS_IOS)
|
||||
// TODO(crbug.com/423883216): Update logic to support Android.
|
||||
if (IsInProgramRegion(Program::kTaiyaki, country_id)) {
|
||||
@@ -258,6 +259,7 @@ bool RegionalCapabilitiesService::IsInSe
|
||||
}
|
||||
|
||||
bool RegionalCapabilitiesService::IsInEeaCountry() {
|
||||
+ return true;
|
||||
// Feature behaviour was directly based on the current country, as a
|
||||
// decentralised way to express a concept we are now framing as "program
|
||||
// settings". Here we check for the program reference directly as command line
|
||||
--- a/components/regional_capabilities/regional_capabilities_utils.cc
|
||||
+++ b/components/regional_capabilities/regional_capabilities_utils.cc
|
||||
@@ -55,7 +55,7 @@ void ShufflePrepopulatedEngines(std::vec
|
||||
|
||||
@@ -152,7 +152,7 @@
|
||||
+ Allow downloading dictionary files for spell checking
|
||||
+ </message>
|
||||
+ <message name="IDS_SETTINGS_HELIUM_SERVICES_SPELLCHECK_TOGGLE_DESCRIPTION" desc="Description of the for enabling/disabling of downloading spellcheck files">
|
||||
+ When enabled, Helium will fetch dictionary files used for spell checking when requested.
|
||||
+ 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_OVERRIDE" desc="Text input for overriding the Helium services server">
|
||||
Use your own instance of Helium services
|
||||
|
||||
@@ -9,15 +9,33 @@
|
||||
|
||||
// The delay before showing the drop target for the side-by-side drag-and-drop
|
||||
// entrypoint.
|
||||
@@ -128,7 +128,7 @@ BASE_FEATURE_PARAM(base::TimeDelta,
|
||||
@@ -128,22 +128,22 @@ BASE_FEATURE_PARAM(base::TimeDelta,
|
||||
kSideBySideShowDropTargetDelay,
|
||||
&kSideBySide,
|
||||
"drop_target_show_delay",
|
||||
- base::Milliseconds(500));
|
||||
+ base::Milliseconds(200));
|
||||
+ base::Milliseconds(250));
|
||||
BASE_FEATURE_PARAM(int,
|
||||
kSideBySideDropTargetMinWidth,
|
||||
&kSideBySide,
|
||||
"drop_target_min_width",
|
||||
- 120);
|
||||
+ 50);
|
||||
BASE_FEATURE_PARAM(int,
|
||||
kSideBySideDropTargetMaxWidth,
|
||||
&kSideBySide,
|
||||
"drop_target_max_width",
|
||||
- 360);
|
||||
+ 80);
|
||||
BASE_FEATURE_PARAM(int,
|
||||
kSideBySideDropTargetTargetWidthPercentage,
|
||||
&kSideBySide,
|
||||
"drop_target_width_percentage",
|
||||
- 30);
|
||||
+ 5);
|
||||
|
||||
constexpr base::FeatureParam<MiniToolbarActiveConfiguration>::Option
|
||||
kMiniToolbarActiveConfigurationOptions[] = {
|
||||
@@ -169,7 +169,7 @@ BASE_FEATURE_PARAM(int,
|
||||
// startup.
|
||||
BASE_FEATURE(kSideBySideSessionRestore,
|
||||
@@ -61,7 +79,20 @@
|
||||
|
||||
MultiContentsView(BrowserView* browser_view,
|
||||
std::unique_ptr<MultiContentsViewDelegate> delegate);
|
||||
@@ -157,10 +156,6 @@ class MultiContentsView : public views::
|
||||
@@ -133,12 +132,6 @@ class MultiContentsView : public views::
|
||||
return *drop_target_controller_;
|
||||
}
|
||||
|
||||
- gfx::Insets& start_contents_view_inset() {
|
||||
- return start_contents_view_inset_;
|
||||
- }
|
||||
-
|
||||
- gfx::Insets& end_contents_view_inset() { return end_contents_view_inset_; }
|
||||
-
|
||||
bool is_drag_and_drop_enabled() const { return is_drag_and_drop_enabled_; }
|
||||
|
||||
void set_min_contents_width_for_testing(int width) {
|
||||
@@ -157,10 +150,6 @@ class MultiContentsView : public views::
|
||||
return contents_container_views_[1]->GetContentsView();
|
||||
}
|
||||
|
||||
@@ -72,6 +103,17 @@
|
||||
private:
|
||||
static constexpr int kMinWebContentsWidth = 200;
|
||||
static constexpr double kMinWebContentsWidthPercentage = 0.1;
|
||||
@@ -226,10 +215,6 @@ class MultiContentsView : public views::
|
||||
// Nullopt if not currently resizing.
|
||||
std::optional<double> initial_start_width_on_resize_;
|
||||
|
||||
- // Insets of the start and end contents view when in split view
|
||||
- gfx::Insets start_contents_view_inset_;
|
||||
- gfx::Insets end_contents_view_inset_;
|
||||
-
|
||||
bool show_inactive_scrim_ = false;
|
||||
|
||||
// This is needed because drag and drop is broken on Wayland. Once that is
|
||||
--- a/chrome/browser/resources/tab_search/split_view/app.css
|
||||
+++ b/chrome/browser/resources/tab_search/split_view/app.css
|
||||
@@ -50,7 +50,7 @@ picture {
|
||||
@@ -93,6 +135,56 @@
|
||||
#include "chrome/browser/ui/views/frame/scrim_view.h"
|
||||
#include "chrome/browser/ui/views/frame/top_container_background.h"
|
||||
#include "chrome/browser/ui/views/new_tab_footer/footer_web_view.h"
|
||||
@@ -42,11 +41,7 @@ MultiContentsView::MultiContentsView(
|
||||
BrowserView* browser_view,
|
||||
std::unique_ptr<MultiContentsViewDelegate> delegate)
|
||||
: browser_view_(browser_view),
|
||||
- delegate_(std::move(delegate)),
|
||||
- start_contents_view_inset_(
|
||||
- gfx::Insets(kSplitViewContentInset).set_top(0).set_right(0)),
|
||||
- end_contents_view_inset_(
|
||||
- gfx::Insets(kSplitViewContentInset).set_top(0).set_left(0)) {
|
||||
+ delegate_(std::move(delegate)) {
|
||||
#if BUILDFLAG(IS_OZONE)
|
||||
if (!ui::OzonePlatform::GetInstance()
|
||||
->GetPlatformProperties()
|
||||
@@ -233,11 +228,8 @@ void MultiContentsView::OnResize(int res
|
||||
std::make_optional(contents_container_views_[0]->size().width());
|
||||
}
|
||||
double total_width = contents_container_views_[0]->size().width() +
|
||||
- contents_container_views_[0]->GetInsets().width() +
|
||||
- contents_container_views_[1]->size().width() +
|
||||
- contents_container_views_[1]->GetInsets().width();
|
||||
+ contents_container_views_[1]->size().width();
|
||||
double end_width = (initial_start_width_on_resize_.value() +
|
||||
- contents_container_views_[0]->GetInsets().width() +
|
||||
static_cast<double>(resize_amount));
|
||||
|
||||
// If end_width is within the snap point widths, update to the snap point.
|
||||
@@ -343,11 +335,6 @@ views::ProposedLayout MultiContentsView:
|
||||
}
|
||||
}
|
||||
|
||||
- if (IsInSplitView()) {
|
||||
- start_rect.Inset(start_contents_view_inset_);
|
||||
- end_rect.Inset(end_contents_view_inset_);
|
||||
- }
|
||||
-
|
||||
layouts.child_layouts.emplace_back(contents_container_views_[0],
|
||||
contents_container_views_[0]->GetVisible(),
|
||||
start_rect);
|
||||
@@ -376,8 +363,10 @@ MultiContentsView::ViewWidths MultiConte
|
||||
widths.resize_width = resize_area_->GetPreferredSize().width();
|
||||
widths.start_width =
|
||||
start_ratio_ * (available_space.width() - widths.resize_width);
|
||||
+
|
||||
+ // +1 to overcorrect for rounding errors that cause a gap on the very edge
|
||||
widths.end_width =
|
||||
- available_space.width() - widths.start_width - widths.resize_width;
|
||||
+ available_space.width() - widths.start_width - widths.resize_width + 1;
|
||||
} else {
|
||||
CHECK(!contents_container_views_[1]->GetVisible());
|
||||
widths.drop_target_width =
|
||||
--- a/chrome/browser/ui/views/frame/contents_container_view.cc
|
||||
+++ b/chrome/browser/ui/views/frame/contents_container_view.cc
|
||||
@@ -14,7 +14,6 @@
|
||||
@@ -364,10 +456,33 @@
|
||||
+constexpr int kOuterPadding = 0;
|
||||
constexpr int kIconSize = 24;
|
||||
-constexpr int kAnimationDurationMs = 450;
|
||||
+constexpr int kAnimationDurationMs = 250;
|
||||
+constexpr int kAnimationDurationMs = 300;
|
||||
|
||||
} // namespace
|
||||
|
||||
@@ -60,13 +60,8 @@ MultiContentsDropTargetView::MultiConten
|
||||
views::FlexSpecification(views::MinimumFlexSizeRule::kScaleToZero,
|
||||
views::MaximumFlexSizeRule::kUnbounded));
|
||||
|
||||
- SetBackground(views::CreateSolidBackground(ui::kColorPrimaryBackground));
|
||||
-
|
||||
auto inner_container = std::make_unique<views::View>();
|
||||
|
||||
- inner_container->SetBackground(views::CreateRoundedRectBackground(
|
||||
- ui::kColorSysSurface3, kInnerCornerRadius));
|
||||
-
|
||||
inner_container->SetLayoutManager(std::make_unique<views::FlexLayout>())
|
||||
->SetOrientation(views::LayoutOrientation::kVertical)
|
||||
.SetMainAxisAlignment(views::LayoutAlignment::kCenter)
|
||||
@@ -169,7 +164,7 @@ bool MultiContentsDropTargetView::Should
|
||||
|
||||
void MultiContentsDropTargetView::OnThemeChanged() {
|
||||
views::View::OnThemeChanged();
|
||||
- SkColor primary_color = GetColorProvider()->GetColor(ui::kColorSysPrimary);
|
||||
+ SkColor primary_color = GetColorProvider()->GetColor(ui::kColorMenuIcon);
|
||||
ui::ImageModel icon_image_model =
|
||||
ui::ImageModel::FromVectorIcon(kAddCircleIcon, primary_color, kIconSize);
|
||||
icon_view_->SetImage(icon_image_model);
|
||||
--- a/components/omnibox/common/omnibox_features.cc
|
||||
+++ b/components/omnibox/common/omnibox_features.cc
|
||||
@@ -380,7 +380,7 @@ BASE_FEATURE(kPreconnectNonSearchOmnibox
|
||||
@@ -379,3 +494,80 @@
|
||||
|
||||
// Enabls adding an aim shortcut in the typed state.
|
||||
BASE_FEATURE(kOmniboxAimShortcutTypedState,
|
||||
--- a/chrome/browser/ui/views/frame/browser_view_layout.cc
|
||||
+++ b/chrome/browser/ui/views/frame/browser_view_layout.cc
|
||||
@@ -824,9 +824,6 @@ void BrowserViewLayout::LayoutContentsCo
|
||||
CalculateContentsContainerLayout(available_bounds);
|
||||
const bool is_in_split = delegate_->IsActiveTabSplit();
|
||||
|
||||
- if (is_in_split) {
|
||||
- UpdateSplitViewInsets();
|
||||
- }
|
||||
contents_container_->SetBoundsRect(layout_result.contents_container_bounds);
|
||||
|
||||
if (unified_side_panel_) {
|
||||
@@ -848,35 +845,6 @@ void BrowserViewLayout::LayoutContentsCo
|
||||
left_aligned_side_panel_separator_->SetBoundsRect(
|
||||
layout_result.separator_bounds);
|
||||
}
|
||||
-
|
||||
- if (side_panel_rounded_corner_) {
|
||||
- SetViewVisibility(side_panel_rounded_corner_,
|
||||
- layout_result.side_panel_visible && !is_in_split);
|
||||
- if (layout_result.side_panel_visible) {
|
||||
- // This can return nullptr when there is no Widget (for context, see
|
||||
- // http://crbug.com/40178332). The nullptr dereference does not always
|
||||
- // crash due to compiler optimizations, so CHECKing here ensures we crash.
|
||||
- CHECK(side_panel_rounded_corner_->GetLayoutProvider());
|
||||
- // Adjust the rounded corner bounds based on the side panel bounds.
|
||||
- const float corner_radius =
|
||||
- side_panel_rounded_corner_->GetLayoutProvider()
|
||||
- ->GetCornerRadiusMetric(
|
||||
- views::ShapeContextTokens::kSidePanelPageContentRadius);
|
||||
- const float corner_size = corner_radius + views::Separator::kThickness;
|
||||
- if (layout_result.contents_container_after_side_panel) {
|
||||
- side_panel_rounded_corner_->SetBounds(
|
||||
- layout_result.side_panel_bounds.right(),
|
||||
- layout_result.side_panel_bounds.y() - views::Separator::kThickness,
|
||||
- corner_size, corner_size);
|
||||
- } else {
|
||||
- side_panel_rounded_corner_->SetBounds(
|
||||
- layout_result.side_panel_bounds.x() - corner_radius -
|
||||
- views::Separator::kThickness,
|
||||
- layout_result.side_panel_bounds.y() - views::Separator::kThickness,
|
||||
- corner_size, corner_size);
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
}
|
||||
|
||||
void BrowserViewLayout::UpdateTopContainerBounds(
|
||||
@@ -988,27 +956,5 @@ bool BrowserViewLayout::IsInfobarVisible
|
||||
// no toolbar or presence of infobar. Similarly the insets for the left and
|
||||
// right of the split view is determined by the side panel.
|
||||
void BrowserViewLayout::UpdateSplitViewInsets() {
|
||||
- SidePanel* side_panel = views::AsViewClass<SidePanel>(unified_side_panel_);
|
||||
- bool has_side_panel = side_panel->GetVisible();
|
||||
- bool is_right_aligned = side_panel->IsRightAligned();
|
||||
- bool is_in_full_screen = browser_view_->IsFullscreen();
|
||||
- bool has_infobar = infobar_container_->GetVisible();
|
||||
-
|
||||
- CHECK(multi_contents_view_);
|
||||
-
|
||||
- multi_contents_view_->start_contents_view_inset()
|
||||
- .set_left(has_side_panel && !is_right_aligned
|
||||
- ? 0
|
||||
- : MultiContentsView::kSplitViewContentInset)
|
||||
- .set_top(!is_in_full_screen && !has_infobar
|
||||
- ? 0
|
||||
- : MultiContentsView::kSplitViewContentInset);
|
||||
-
|
||||
- multi_contents_view_->end_contents_view_inset()
|
||||
- .set_right(has_side_panel && is_right_aligned
|
||||
- ? 0
|
||||
- : MultiContentsView::kSplitViewContentInset)
|
||||
- .set_top(!is_in_full_screen && !has_infobar
|
||||
- ? 0
|
||||
- : MultiContentsView::kSplitViewContentInset);
|
||||
+ return;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,259 @@
|
||||
--- a/components/helium_services/helium_services_helpers.cc
|
||||
+++ b/components/helium_services/helium_services_helpers.cc
|
||||
@@ -88,6 +88,11 @@ bool ShouldAccessUpdateService(const Pre
|
||||
prefs.GetBoolean(prefs::kHeliumUpdateFetchingEnabled);
|
||||
}
|
||||
|
||||
+bool ShouldAccessUBlockAssets(const PrefService& prefs) {
|
||||
+ return ShouldAccessServices(prefs) &&
|
||||
+ prefs.GetBoolean(prefs::kHeliumUBlockAssetsEnabled);
|
||||
+}
|
||||
+
|
||||
GURL GetExtensionUpdateURL(const PrefService& prefs) {
|
||||
if (!ShouldAccessExtensionService(prefs)) {
|
||||
return GetDummyURL();
|
||||
@@ -127,6 +132,14 @@ GURL GetBrowserUpdateURL(const PrefServi
|
||||
#endif
|
||||
}
|
||||
|
||||
+GURL GetUBlockAssetsURL(const PrefService& prefs) {
|
||||
+ if (!ShouldAccessUBlockAssets(prefs)) {
|
||||
+ return GetDummyURL();
|
||||
+ }
|
||||
+
|
||||
+ return GetServicesBaseURL(prefs).Resolve("/ubo/assets.json");
|
||||
+}
|
||||
+
|
||||
void ConfigurePrefChangeRegistrarFor(std::string_view pref_name,
|
||||
PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer) {
|
||||
registrar.Add(prefs::kHeliumServicesEnabled, observer);
|
||||
--- a/components/helium_services/helium_services_helpers.h
|
||||
+++ b/components/helium_services/helium_services_helpers.h
|
||||
@@ -21,12 +21,14 @@ const char kHeliumDummyOrigin[] =
|
||||
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 ShouldAccessUBlockAssets(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetServicesBaseURL(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetDummyURL();
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetExtensionUpdateURL(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetWebstoreSnippetURL(const PrefService& prefs, std::string_view id);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetSpellcheckURL(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetBrowserUpdateURL(const PrefService& prefs);
|
||||
+COMPONENT_EXPORT(HELIUM) GURL GetUBlockAssetsURL(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) std::optional<GURL> GetValidUserOverridenURL(std::string_view user_url_);
|
||||
COMPONENT_EXPORT(HELIUM) void ConfigurePrefChangeRegistrarFor(std::string_view pref_name,
|
||||
PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer);
|
||||
--- a/components/helium_services/pref_names.h
|
||||
+++ b/components/helium_services/pref_names.h
|
||||
@@ -33,6 +33,8 @@ inline constexpr char kHeliumUpdateFetch
|
||||
inline constexpr char kHeliumSpellcheckEnabled[] =
|
||||
"helium.services.spellcheck_files";
|
||||
|
||||
+inline constexpr char kHeliumUBlockAssetsEnabled[] =
|
||||
+ "helium.services.ublock_assets";
|
||||
} // namespace prefs
|
||||
|
||||
#endif // COMPONENTS_HELIUM_SERVICES_PREF_NAMES_H_
|
||||
--- a/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
+++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc
|
||||
@@ -364,6 +364,8 @@ const PrefsUtil::TypedPrefMap& PrefsUtil
|
||||
settings_api::PrefType::kBoolean;
|
||||
(*s_allowlist)[::prefs::kHeliumUpdateFetchingEnabled] =
|
||||
settings_api::PrefType::kBoolean;
|
||||
+ (*s_allowlist)[::prefs::kHeliumUBlockAssetsEnabled] =
|
||||
+ settings_api::PrefType::kBoolean;
|
||||
(*s_allowlist)[::prefs::kHeliumServicesOrigin] =
|
||||
settings_api::PrefType::kString;
|
||||
|
||||
--- a/chrome/browser/ui/browser_ui_prefs.cc
|
||||
+++ b/chrome/browser/ui/browser_ui_prefs.cc
|
||||
@@ -208,6 +208,7 @@ void RegisterBrowserUserPrefs(user_prefs
|
||||
registry->RegisterBooleanPref(prefs::kHeliumDidOnboarding, false);
|
||||
registry->RegisterBooleanPref(prefs::kHeliumServicesConsented, false);
|
||||
registry->RegisterBooleanPref(prefs::kHeliumUpdateFetchingEnabled, true);
|
||||
+ registry->RegisterBooleanPref(prefs::kHeliumUBlockAssetsEnabled, true);
|
||||
}
|
||||
|
||||
registry->RegisterBooleanPref(
|
||||
--- a/chrome/browser/extensions/extension_service.cc
|
||||
+++ b/chrome/browser/extensions/extension_service.cc
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/syslog_logging.h"
|
||||
#include "base/task/single_thread_task_runner.h"
|
||||
+#include "base/task/thread_pool.h"
|
||||
#include "base/threading/thread_restrictions.h"
|
||||
#include "base/time/time.h"
|
||||
#include "base/trace_event/trace_event.h"
|
||||
@@ -72,6 +73,9 @@
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "chrome/common/url_constants.h"
|
||||
#include "components/crx_file/id_util.h"
|
||||
+#include "components/helium_services/extension_ids.h"
|
||||
+#include "components/helium_services/helium_services_helpers.h"
|
||||
+#include "components/helium_services/pref_names.h"
|
||||
#include "components/policy/core/common/policy_pref_names.h"
|
||||
#include "components/supervised_user/core/browser/supervised_user_preferences.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
@@ -199,6 +203,7 @@ ExtensionService::ExtensionService(
|
||||
ready_(ready),
|
||||
updater_(ExtensionUpdater::Get(profile)),
|
||||
component_loader_(ComponentLoader::Get(profile_)),
|
||||
+ can_access_ublock_assets_(helium::ShouldAccessUBlockAssets(*profile_->GetPrefs())),
|
||||
error_controller_(error_controller),
|
||||
external_install_manager_(ExternalInstallManager::Get(profile)),
|
||||
extension_registrar_delegate_(
|
||||
@@ -272,6 +277,33 @@ ExtensionService::ExtensionService(
|
||||
prefs::kExtensionsUIDeveloperMode,
|
||||
base::BindRepeating(&ExtensionService::OnDeveloperModePrefChanged,
|
||||
base::Unretained(this)));
|
||||
+ helium::ConfigurePrefChangeRegistrarFor(
|
||||
+ prefs::kHeliumUBlockAssetsEnabled,
|
||||
+ pref_change_registrar_,
|
||||
+ base::BindRepeating(&ExtensionService::ToggleUBlockExtension,
|
||||
+ base::Unretained(this)));
|
||||
+}
|
||||
+
|
||||
+void ExtensionService::ToggleUBlockExtension() {
|
||||
+ if (!extension_registrar_) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ bool has_permission_now = helium::ShouldAccessUBlockAssets(*profile_->GetPrefs());
|
||||
+ if (can_access_ublock_assets_ == has_permission_now) {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ can_access_ublock_assets_ = has_permission_now;
|
||||
+
|
||||
+ for (int seconds : {0, 5}) {
|
||||
+ content::GetUIThreadTaskRunner({base::TaskPriority::BEST_EFFORT})->PostDelayedTask(
|
||||
+ FROM_HERE,
|
||||
+ base::BindOnce(&ExtensionRegistrar::ReloadExtension,
|
||||
+ extension_registrar_->GetWeakPtr(),
|
||||
+ helium::kUBlockOriginComponentId),
|
||||
+ base::Seconds(seconds));
|
||||
+ }
|
||||
}
|
||||
|
||||
base::WeakPtr<ExtensionServiceInterface> ExtensionService::AsWeakPtr() {
|
||||
--- a/chrome/browser/extensions/extension_service.h
|
||||
+++ b/chrome/browser/extensions/extension_service.h
|
||||
@@ -165,6 +165,8 @@ class ExtensionService : public Extensio
|
||||
// KeyedService two-phase shutdown.
|
||||
void Shutdown();
|
||||
|
||||
+ void ToggleUBlockExtension();
|
||||
+
|
||||
// Performs action based on verdicts received from the Extension Telemetry
|
||||
// server. Currently, these verdicts are limited to off-store extensions.
|
||||
void PerformActionBasedOnExtensionTelemetryServiceVerdicts(
|
||||
@@ -355,6 +357,8 @@ class ExtensionService : public Extensio
|
||||
// Used in test to ensure the service's shutdown method has been called.
|
||||
bool is_shut_down_executed_ = false;
|
||||
|
||||
+ bool can_access_ublock_assets_;
|
||||
+
|
||||
// The controller for the UI that alerts the user about any blocklisted
|
||||
// extensions. Not owned.
|
||||
raw_ptr<ExtensionErrorController> error_controller_ = nullptr;
|
||||
--- a/extensions/browser/api/storage/BUILD.gn
|
||||
+++ b/extensions/browser/api/storage/BUILD.gn
|
||||
@@ -60,6 +60,7 @@ source_set("storage") {
|
||||
":settings_namespace",
|
||||
":settings_observer",
|
||||
"//base",
|
||||
+ "//components/helium_services",
|
||||
"//components/keyed_service/content",
|
||||
"//components/value_store",
|
||||
"//content/public/browser",
|
||||
--- a/extensions/browser/api/storage/storage_frontend.cc
|
||||
+++ b/extensions/browser/api/storage/storage_frontend.cc
|
||||
@@ -25,6 +25,8 @@
|
||||
#include "base/strings/string_util.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "base/trace_event/trace_event.h"
|
||||
+#include "chrome/browser/profiles/profile.h"
|
||||
+#include "components/helium_services/helium_services_helpers.h"
|
||||
#include "components/value_store/value_store_factory.h"
|
||||
#include "content/public/browser/browser_context.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
@@ -222,6 +224,24 @@ void StorageFrontend::OnReadFinished(
|
||||
|
||||
if (success) {
|
||||
get_result.data = result.PassSettings();
|
||||
+
|
||||
+ Profile* profile_ = Profile::FromBrowserContext(browser_context_);
|
||||
+
|
||||
+ if (Manifest::IsUBlockComponent(extension_id)
|
||||
+ && storage_area == StorageAreaNamespace::kManaged
|
||||
+ && helium::ShouldAccessUBlockAssets(*profile_->GetPrefs())) {
|
||||
+
|
||||
+ if (!get_result.data->FindDict("adminSettings")) {
|
||||
+ get_result.data->Set("adminSettings", base::Value::Dict());
|
||||
+ }
|
||||
+
|
||||
+ base::Value::Dict* adminSettings = get_result.data->FindDict("adminSettings");
|
||||
+
|
||||
+ if (!adminSettings->Find("assetsBootstrapLocation")) {
|
||||
+ adminSettings->Set("assetsBootstrapLocation",
|
||||
+ base::Value(helium::GetUBlockAssetsURL(*profile_->GetPrefs()).spec()));
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
|
||||
std::move(callback).Run(std::move(get_result));
|
||||
--- a/third_party/ublock/js/assets.js
|
||||
+++ b/third_party/ublock/js/assets.js
|
||||
@@ -525,7 +525,7 @@ let assetSourceRegistry = Object.create(
|
||||
function getAssetSourceRegistry() {
|
||||
if ( assetSourceRegistryPromise === undefined ) {
|
||||
assetSourceRegistryPromise = cacheStorage.get(
|
||||
- 'assetSourceRegistry'
|
||||
+ 'assetSourceRegistry' + (µb.assetsBootstrapLocation ?? '')
|
||||
).then(bin => {
|
||||
if ( bin instanceof Object ) {
|
||||
if ( bin.assetSourceRegistry instanceof Object ) {
|
||||
--- a/chrome/app/settings_strings.grdp
|
||||
+++ b/chrome/app/settings_strings.grdp
|
||||
@@ -1957,6 +1957,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>
|
||||
+ <message name="IDS_SETTINGS_HELIUM_SERVICES_UBO" desc="Description of the toggle for uBO filter lists">
|
||||
+ Allow downloading filter lists for uBlock Origin
|
||||
+ </message>
|
||||
+ <message name="IDS_SETTINGS_HELIUM_SERVICES_UBO_DESCRIPTION" desc="Description of the toggle for automatic update downloads">
|
||||
+ Helium will fetch fresh filter lists for uBlock Origin. All requests to lists are proxied to protect your privacy. When disabled, default filter lists will be loaded from local storage, which are only updated along with Helium. Optional filter lists will be requested without proxying.
|
||||
+ </message>
|
||||
<message name="IDS_SETTINGS_HELIUM_SERVICES_OVERRIDE" desc="Text input for overriding the Helium services server">
|
||||
Use your own instance of Helium services
|
||||
</message>
|
||||
--- a/chrome/browser/resources/settings/privacy_page/services_page.html
|
||||
+++ b/chrome/browser/resources/settings/privacy_page/services_page.html
|
||||
@@ -36,6 +36,11 @@
|
||||
sub-label="$i18n{heliumUpdatesToggleDescription}">
|
||||
</settings-toggle-button>
|
||||
</if>
|
||||
+ <settings-toggle-button id="filterlistToggleButton"
|
||||
+ pref="{{prefs.helium.services.ublock_assets}}"
|
||||
+ label="$i18n{heliumUboToggle}"
|
||||
+ sub-label="$i18n{heliumUboToggleDescription}">
|
||||
+ </settings-toggle-button>
|
||||
</cr-collapse>
|
||||
</div>
|
||||
</div>
|
||||
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
@@ -1963,6 +1963,10 @@ void AddPrivacyStrings(content::WebUIDat
|
||||
IDS_SETTINGS_HELIUM_SERVICES_UPDATE},
|
||||
{"heliumUpdatesToggleDescription",
|
||||
IDS_SETTINGS_HELIUM_SERVICES_UPDATE_DESCRIPTION},
|
||||
+ {"heliumUboToggle",
|
||||
+ IDS_SETTINGS_HELIUM_SERVICES_UBO},
|
||||
+ {"heliumUboToggleDescription",
|
||||
+ IDS_SETTINGS_HELIUM_SERVICES_UBO_DESCRIPTION},
|
||||
{"heliumOriginOverride", IDS_SETTINGS_HELIUM_SERVICES_OVERRIDE},
|
||||
{"heliumOriginOverrideDescription",
|
||||
IDS_SETTINGS_HELIUM_SERVICES_OVERRIDE_DESCRIPTION},
|
||||
@@ -0,0 +1,111 @@
|
||||
--- /dev/null
|
||||
+++ b/components/helium_services/extension_ids.h
|
||||
@@ -0,0 +1,18 @@
|
||||
+// 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_EXTENSION_IDS_H_
|
||||
+#define COMPONENTS_HELIUM_SERVICES_EXTENSION_IDS_H_
|
||||
+
|
||||
+namespace helium {
|
||||
+
|
||||
+inline constexpr char kUBlockOriginWebstoreId[] =
|
||||
+ "cjpalhdlnbpafiamejdnhcphjbkeiagm";
|
||||
+
|
||||
+inline constexpr char kUBlockOriginComponentId[] =
|
||||
+ "blockjmkbacgjkknlgpkjjiijinjdanf";
|
||||
+
|
||||
+} // namespace helium
|
||||
+
|
||||
+#endif /* COMPONENTS_HELIUM_SERVICES_EXTENSION_IDS_H_ */
|
||||
--- a/chrome/browser/extensions/component_loader.h
|
||||
+++ b/chrome/browser/extensions/component_loader.h
|
||||
@@ -215,6 +215,7 @@ class ComponentLoader : public KeyedServ
|
||||
const std::string& name_string,
|
||||
const std::string& description_string);
|
||||
void AddWebStoreApp();
|
||||
+ void AddUBlock();
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
void AddChromeApp();
|
||||
--- a/chrome/browser/extensions/component_loader.cc
|
||||
+++ b/chrome/browser/extensions/component_loader.cc
|
||||
@@ -57,6 +57,7 @@
|
||||
#include "ui/accessibility/accessibility_features.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
#include "ui/base/resource/resource_bundle.h"
|
||||
+#include "third_party/ublock/resources/grit/ublock_resources.h"
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
#include "ash/constants/ash_features.h"
|
||||
@@ -429,6 +430,21 @@ void ComponentLoader::AddWebStoreApp() {
|
||||
l10n_util::GetStringUTF8(IDS_WEBSTORE_APP_DESCRIPTION));
|
||||
}
|
||||
|
||||
+void ComponentLoader::AddUBlock() {
|
||||
+ Add(IDR_UBLOCK_MANIFEST_JSON, base::FilePath(FILE_PATH_LITERAL("ublock")));
|
||||
+
|
||||
+ using namespace extension_l10n_util;
|
||||
+ ComponentExtensionInfo& info = component_extensions_.back();
|
||||
+ std::string error;
|
||||
+ bool localized = LocalizeExtension(info.root_directory, &info.manifest,
|
||||
+ GzippedMessagesPermission::kAllowForTrustedSource,
|
||||
+ &error, true);
|
||||
+
|
||||
+ if (!localized) {
|
||||
+ LOG(ERROR) << "Failed to localize uBlock: " << error;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
void ComponentLoader::AddChromeApp() {
|
||||
AddWithNameAndDescription(
|
||||
@@ -506,6 +522,7 @@ void ComponentLoader::AddDefaultComponen
|
||||
|
||||
if (!skip_session_components) {
|
||||
AddWebStoreApp();
|
||||
+ AddUBlock();
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
AddChromeApp();
|
||||
#endif // BUILDFLAG(IS_CHROMEOS)
|
||||
--- a/chrome/browser/extensions/component_extensions_allowlist/allowlist.cc
|
||||
+++ b/chrome/browser/extensions/component_extensions_allowlist/allowlist.cc
|
||||
@@ -15,8 +15,10 @@
|
||||
#include "chrome/common/buildflags.h"
|
||||
#include "chrome/common/extensions/extension_constants.h"
|
||||
#include "chrome/grit/browser_resources.h"
|
||||
+#include "components/helium_services/extension_ids.h"
|
||||
#include "extensions/common/constants.h"
|
||||
#include "printing/buildflags/buildflags.h"
|
||||
+#include "third_party/ublock/resources/grit/ublock_resources.h"
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
#include "ash/keyboard/ui/grit/keyboard_resources.h"
|
||||
@@ -31,6 +33,7 @@ bool IsComponentExtensionAllowlisted(con
|
||||
constexpr auto kAllowed = base::MakeFixedFlatSet<std::string_view>({
|
||||
extension_misc::kInAppPaymentsSupportAppId,
|
||||
extension_misc::kPdfExtensionId,
|
||||
+ helium::kUBlockOriginComponentId,
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
extension_misc::kAssessmentAssistantExtensionId,
|
||||
extension_misc::kAccessibilityCommonExtensionId,
|
||||
@@ -86,6 +89,7 @@ bool IsComponentExtensionAllowlisted(int
|
||||
case IDR_NETWORK_SPEECH_SYNTHESIS_MANIFEST_MV3:
|
||||
case IDR_READING_MODE_GDOCS_HELPER_MANIFEST:
|
||||
case IDR_WEBSTORE_MANIFEST:
|
||||
+ case IDR_UBLOCK_MANIFEST_JSON:
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
// Separate ChromeOS list, as it is quite large.
|
||||
--- a/ui/base/resource/resource_bundle.cc
|
||||
+++ b/ui/base/resource/resource_bundle.cc
|
||||
@@ -768,7 +768,7 @@ base::RefCountedMemory* ResourceBundle::
|
||||
|
||||
std::string_view data = GetRawDataResourceForScale(resource_id, scale_factor);
|
||||
if (data.empty())
|
||||
- return nullptr;
|
||||
+ return new base::RefCountedString(); // fixes accessing "web_accessible_resources/empty" in u0
|
||||
|
||||
if (net::GZipHeader::HasGZipHeader(base::as_byte_span(data)) ||
|
||||
HasBrotliHeader(data)) {
|
||||
@@ -0,0 +1,129 @@
|
||||
--- a/chrome/browser/extensions/chrome_extension_registrar_delegate.cc
|
||||
+++ b/chrome/browser/extensions/chrome_extension_registrar_delegate.cc
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "base/metrics/histogram_functions.h"
|
||||
#include "base/metrics/histogram_macros.h"
|
||||
#include "base/notimplemented.h"
|
||||
+#include "base/task/thread_pool.h"
|
||||
#include "chrome/browser/extensions/component_loader.h"
|
||||
#include "chrome/browser/extensions/corrupted_extension_reinstaller.h"
|
||||
#include "chrome/browser/extensions/data_deleter.h"
|
||||
@@ -31,6 +32,9 @@
|
||||
#include "chrome/browser/ui/webui/favicon_source.h"
|
||||
#include "chrome/common/webui_url_constants.h"
|
||||
#include "components/favicon_base/favicon_url_parser.h"
|
||||
+#include "components/helium_services/extension_ids.h"
|
||||
+#include "components/value_store/value_store.h"
|
||||
+#include "extensions/browser/api/storage/storage_frontend.h"
|
||||
#include "extensions/browser/delayed_install_manager.h"
|
||||
#include "extensions/browser/disable_reason.h"
|
||||
#include "extensions/browser/extension_file_task_runner.h"
|
||||
@@ -248,7 +252,85 @@ void ChromeExtensionRegistrarDelegate::P
|
||||
}
|
||||
}
|
||||
|
||||
- DataDeleter::StartDeleting(profile_, extension.get(), subtask_done_callback);
|
||||
+ ChromeExtensionRegistrarDelegate::MaybeMigrateUBlockPrefs(
|
||||
+ extension, base::BindOnce([](Profile* profile,
|
||||
+ scoped_refptr<const Extension> extension,
|
||||
+ base::OnceClosure cb) {
|
||||
+ content::GetUIThreadTaskRunner({})->PostTask(FROM_HERE,
|
||||
+ base::BindOnce(&DataDeleter::StartDeleting,
|
||||
+ profile, base::RetainedRef(extension),
|
||||
+ std::move(cb)));
|
||||
+ }, profile_, extension, std::move(subtask_done_callback)));
|
||||
+}
|
||||
+
|
||||
+void ChromeExtensionRegistrarDelegate::MaybeMigrateUBlockPrefs(
|
||||
+ scoped_refptr<const Extension> extension,
|
||||
+ base::OnceClosure callback) {
|
||||
+ StorageFrontend* frontend = StorageFrontend::Get(profile_);
|
||||
+ scoped_refptr<const Extension> component = registry_->GetExtensionById(
|
||||
+ helium::kUBlockOriginComponentId, ExtensionRegistry::EVERYTHING);
|
||||
+
|
||||
+ if (!frontend || extension->id() != helium::kUBlockOriginWebstoreId || !component) {
|
||||
+ if (!component) {
|
||||
+ LOG(ERROR) << "component-based ublock is missing, skipping migration";
|
||||
+ }
|
||||
+ std::move(callback).Run();
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ std::array namespaces = { settings_namespace::LOCAL,
|
||||
+ settings_namespace::SYNC };
|
||||
+ base::RepeatingClosure barrier_cb =
|
||||
+ base::BarrierClosure(namespaces.size(), std::move(callback));
|
||||
+
|
||||
+ for (settings_namespace::Namespace ns : namespaces) {
|
||||
+ ValueStoreCache* store_cache = frontend->GetValueStoreCache(ns);
|
||||
+ if (!store_cache) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ GetExtensionFileTaskRunner()->PostTask(FROM_HERE,
|
||||
+ base::BindOnce(
|
||||
+ &ValueStoreCache::RunWithValueStoreForExtension,
|
||||
+ base::Unretained(store_cache),
|
||||
+ base::BindOnce([] (base::WeakPtr<ChromeExtensionRegistrarDelegate> weak_ptr,
|
||||
+ scoped_refptr<const Extension> component,
|
||||
+ ValueStoreCache* store_cache,
|
||||
+ base::RepeatingClosure cb,
|
||||
+ value_store::ValueStore* old) {
|
||||
+ store_cache->RunWithValueStoreForExtension(
|
||||
+ base::BindOnce(
|
||||
+ &ChromeExtensionRegistrarDelegate::HandleUblockPrefsMigration,
|
||||
+ weak_ptr, old).Then(std::move(cb)), component);
|
||||
+ }, weak_factory_.GetWeakPtr(), component, store_cache, barrier_cb),
|
||||
+ extension));
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+void ChromeExtensionRegistrarDelegate::HandleUblockPrefsMigration(
|
||||
+ value_store::ValueStore* old_, value_store::ValueStore* new_) {
|
||||
+ if (!old_ || !new_) {
|
||||
+ LOG(ERROR) << "missing old/new";
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ auto oldValues = old_->Get();
|
||||
+ if (!oldValues.status().ok()) {
|
||||
+ LOG(ERROR) << "failed getting webstore uBlock prefs";
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ auto getKeysResult = new_->GetKeys();
|
||||
+ CHECK(getKeysResult.status().ok());
|
||||
+
|
||||
+ auto existingKeys = getKeysResult.PassSettings();
|
||||
+ for (const auto [ key, value ] : oldValues.PassSettings()) {
|
||||
+ if (existingKeys.Find(key)) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ new_->Set(value_store::ValueStore::DEFAULTS, key, value);
|
||||
+ }
|
||||
}
|
||||
|
||||
void ChromeExtensionRegistrarDelegate::DoLoadExtensionForReload(
|
||||
--- a/chrome/browser/extensions/chrome_extension_registrar_delegate.h
|
||||
+++ b/chrome/browser/extensions/chrome_extension_registrar_delegate.h
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "base/memory/raw_ptr.h"
|
||||
#include "base/memory/weak_ptr.h"
|
||||
+#include "components/value_store/value_store.h"
|
||||
#include "extensions/browser/extension_registrar.h"
|
||||
#include "extensions/buildflags/buildflags.h"
|
||||
|
||||
@@ -51,6 +52,11 @@ class ChromeExtensionRegistrarDelegate :
|
||||
void PreUninstallExtension(scoped_refptr<const Extension> extension) override;
|
||||
void PostUninstallExtension(scoped_refptr<const Extension> extension,
|
||||
base::OnceClosure done_callback) override;
|
||||
+ void MaybeMigrateUBlockPrefs(scoped_refptr<const Extension> extension,
|
||||
+ base::OnceClosure callback);
|
||||
+ void HandleUblockPrefsMigration(value_store::ValueStore* old_,
|
||||
+ value_store::ValueStore* new_);
|
||||
+
|
||||
void LoadExtensionForReload(const ExtensionId& extension_id,
|
||||
const base::FilePath& path) override;
|
||||
void LoadExtensionForReloadWithQuietFailure(
|
||||
@@ -0,0 +1,225 @@
|
||||
--- a/extensions/common/manifest.h
|
||||
+++ b/extensions/common/manifest.h
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "extensions/common/extension_id.h"
|
||||
#include "extensions/common/hashed_extension_id.h"
|
||||
#include "extensions/common/mojom/manifest.mojom-shared.h"
|
||||
+#include "components/helium_services/extension_ids.h"
|
||||
|
||||
namespace extensions {
|
||||
struct InstallWarning;
|
||||
@@ -90,6 +91,10 @@ class Manifest final {
|
||||
location == mojom::ManifestLocation::kExternalComponent;
|
||||
}
|
||||
|
||||
+ static inline bool IsUBlockComponent(std::string_view extension_id) {
|
||||
+ return extension_id == helium::kUBlockOriginComponentId;
|
||||
+ }
|
||||
+
|
||||
static inline bool IsValidLocation(mojom::ManifestLocation location) {
|
||||
return location > mojom::ManifestLocation::kInvalidLocation &&
|
||||
location <= mojom::ManifestLocation::kMaxValue;
|
||||
--- a/chrome/browser/chrome_content_browser_client.cc
|
||||
+++ b/chrome/browser/chrome_content_browser_client.cc
|
||||
@@ -6171,7 +6171,8 @@ void AddChromeSchemeFactories(
|
||||
std::vector<std::string> allowed_webui_hosts;
|
||||
// Support for chrome:// scheme if appropriate.
|
||||
if ((extension->is_extension() || extension->is_platform_app()) &&
|
||||
- Manifest::IsComponentLocation(extension->location())) {
|
||||
+ Manifest::IsComponentLocation(extension->location())
|
||||
+ && !Manifest::IsUBlockComponent(extension->id())) {
|
||||
// Components of chrome that are implemented as extensions or platform apps
|
||||
// are allowed to use chrome://resources/ and chrome://theme/ URLs.
|
||||
allowed_webui_hosts.emplace_back(content::kChromeUIResourcesHost);
|
||||
--- a/chrome/browser/ui/views/apps/app_info_dialog/app_info_summary_panel.cc
|
||||
+++ b/chrome/browser/ui/views/apps/app_info_dialog/app_info_summary_panel.cc
|
||||
@@ -156,8 +156,11 @@ void AppInfoSummaryPanel::AddDescription
|
||||
}
|
||||
|
||||
void AppInfoSummaryPanel::AddDetailsControl(views::View* vertical_stack) {
|
||||
+ using namespace extensions;
|
||||
+
|
||||
// Component apps have no details.
|
||||
- if (app_->location() == extensions::mojom::ManifestLocation::kComponent) {
|
||||
+ if (Manifest::IsComponentLocation(app_->location())
|
||||
+ && !Manifest::IsUBlockComponent(app_->id())) {
|
||||
return;
|
||||
}
|
||||
|
||||
--- a/chrome/common/extensions/chrome_extensions_client.cc
|
||||
+++ b/chrome/common/extensions/chrome_extensions_client.cc
|
||||
@@ -214,8 +214,9 @@ void ChromeExtensionsClient::AddOriginAc
|
||||
// conservative. Components shouldn't be subject to enterprise policy controls
|
||||
// or blocking access to the webstore so they get the highest priority
|
||||
// allowlist entry.
|
||||
- if (extensions::Manifest::IsComponentLocation(extension.location()) &&
|
||||
- is_extension_active) {
|
||||
+ if (extensions::Manifest::IsComponentLocation(extension.location())
|
||||
+ && !extensions::Manifest::IsUBlockComponent(extension.id())
|
||||
+ && is_extension_active) {
|
||||
origin_patterns->push_back(network::mojom::CorsOriginPattern::New(
|
||||
content::kChromeUIScheme, chrome::kChromeUIThemeHost, /*port=*/0,
|
||||
network::mojom::CorsDomainMatchMode::kDisallowSubdomains,
|
||||
--- a/extensions/common/permissions/permissions_data.cc
|
||||
+++ b/extensions/common/permissions/permissions_data.cc
|
||||
@@ -114,7 +114,8 @@ void PermissionsData::SetPolicyDelegate(
|
||||
bool PermissionsData::CanExecuteScriptEverywhere(
|
||||
const ExtensionId& extension_id,
|
||||
mojom::ManifestLocation location) {
|
||||
- if (location == mojom::ManifestLocation::kComponent)
|
||||
+ if (location == mojom::ManifestLocation::kComponent
|
||||
+ && !Manifest::IsUBlockComponent(extension_id))
|
||||
return true;
|
||||
|
||||
const ExtensionsClient::ScriptingAllowlist& allowlist =
|
||||
@@ -479,7 +480,8 @@ bool PermissionsData::CanCaptureVisibleP
|
||||
// blocked host in a different page and then capture that, but it's better
|
||||
// than nothing (and policy hosts can set their x-frame options
|
||||
// accordingly).
|
||||
- if (location_ != mojom::ManifestLocation::kComponent &&
|
||||
+ if ((location_ != mojom::ManifestLocation::kComponent
|
||||
+ || Manifest::IsUBlockComponent(extension_id_)) &&
|
||||
IsPolicyBlockedHostUnsafe(origin_url)) {
|
||||
if (error)
|
||||
*error = extension_misc::kPolicyBlockedScripting;
|
||||
@@ -617,7 +619,8 @@ PermissionsData::PageAccess PermissionsD
|
||||
const URLPatternSet* tab_url_patterns,
|
||||
std::string* error) const {
|
||||
runtime_lock_.AssertAcquired();
|
||||
- if (location_ != mojom::ManifestLocation::kComponent &&
|
||||
+ if ((location_ != mojom::ManifestLocation::kComponent
|
||||
+ || Manifest::IsUBlockComponent(extension_id_)) &&
|
||||
IsPolicyBlockedHostUnsafe(document_url)) {
|
||||
if (error)
|
||||
*error = extension_misc::kPolicyBlockedScripting;
|
||||
@@ -629,7 +632,8 @@ PermissionsData::PageAccess PermissionsD
|
||||
|
||||
if (base::FeatureList::IsEnabled(
|
||||
extensions_features::kExtensionsMenuAccessControl) &&
|
||||
- context_id_ && location_ != mojom::ManifestLocation::kComponent &&
|
||||
+ context_id_ && (location_ != mojom::ManifestLocation::kComponent
|
||||
+ || Manifest::IsUBlockComponent(extension_id_)) &&
|
||||
!Manifest::IsPolicyLocation(location_)) {
|
||||
base::AutoLock lock(GetContextPermissionsLock());
|
||||
auto& context_permissions = GetContextPermissions(*context_id_);
|
||||
--- a/chrome/browser/extensions/extension_util.cc
|
||||
+++ b/chrome/browser/extensions/extension_util.cc
|
||||
@@ -186,7 +186,8 @@ void SetIsIncognitoEnabled(const std::st
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
// TODO(treib,kalman): Should this be Manifest::IsComponentLocation(..)?
|
||||
// (which also checks for kExternalComponent).
|
||||
- if (extension->location() == mojom::ManifestLocation::kComponent) {
|
||||
+ if (extension->location() == mojom::ManifestLocation::kComponent
|
||||
+ && !Manifest::IsUBlockComponent(extension->id())) {
|
||||
// This shouldn't be called for component extensions unless it is called
|
||||
// by sync, for syncable component extensions.
|
||||
// See http://crbug.com/112290 and associated CLs for the sordid history.
|
||||
--- a/chrome/browser/extensions/standard_management_policy_provider.cc
|
||||
+++ b/chrome/browser/extensions/standard_management_policy_provider.cc
|
||||
@@ -27,6 +27,14 @@ namespace {
|
||||
bool AdminPolicyIsModifiable(const Extension* source_extension,
|
||||
const Extension* extension,
|
||||
std::u16string* error) {
|
||||
+ bool is_u0 = Manifest::IsUBlockComponent(extension->id());
|
||||
+
|
||||
+ if (source_extension && Manifest::IsUBlockComponent(source_extension->id())) {
|
||||
+ return is_u0;
|
||||
+ } else if (source_extension == nullptr && is_u0) {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
// Component and force installed extensions can enable/disable all other
|
||||
// extensions including force installed ones (but component are off limits).
|
||||
const bool component_or_force_installed =
|
||||
@@ -239,6 +247,11 @@ bool StandardManagementPolicyProvider::M
|
||||
const Extension* extension,
|
||||
std::u16string* error) const {
|
||||
ManagedInstallationMode mode = settings_->GetInstallationMode(extension);
|
||||
+
|
||||
+ if (Manifest::IsComponentLocation(extension->location())) {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
// Disallow removing of recommended extension, to avoid re-install it
|
||||
// again while policy is reload. But disabling of recommended extension is
|
||||
// allowed.
|
||||
--- a/extensions/browser/extension_util.cc
|
||||
+++ b/extensions/browser/extension_util.cc
|
||||
@@ -94,7 +94,8 @@ bool IsIncognitoEnabled(const ExtensionI
|
||||
}
|
||||
// If this is an existing component extension we always allow it to
|
||||
// work in incognito mode.
|
||||
- if (Manifest::IsComponentLocation(extension->location())) {
|
||||
+ if (Manifest::IsComponentLocation(extension->location())
|
||||
+ && !Manifest::IsUBlockComponent(extension->id())) {
|
||||
return true;
|
||||
}
|
||||
if (extension->is_login_screen_extension()) {
|
||||
--- a/extensions/browser/extension_prefs.cc
|
||||
+++ b/extensions/browser/extension_prefs.cc
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "build/build_config.h"
|
||||
#include "components/content_settings/core/common/content_settings.h"
|
||||
#include "components/crx_file/id_util.h"
|
||||
+#include "components/helium_services/extension_ids.h"
|
||||
#include "components/pref_registry/pref_registry_syncable.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
#include "components/supervised_user/core/common/buildflags.h"
|
||||
@@ -707,11 +708,18 @@ bool ExtensionPrefs::ReadPrefAsBoolean(c
|
||||
std::string_view pref_key,
|
||||
bool* out_value) const {
|
||||
const base::Value::Dict* ext = GetExtensionPref(extension_id);
|
||||
- if (!ext) {
|
||||
- return false;
|
||||
+ std::optional<bool> value;
|
||||
+
|
||||
+ if (ext) {
|
||||
+ value = ext->FindBoolByDottedPath(pref_key);
|
||||
+ }
|
||||
+
|
||||
+ if (!value.has_value()
|
||||
+ && extension_id == helium::kUBlockOriginComponentId
|
||||
+ && pref_key == kPrefIncognitoEnabled) {
|
||||
+ value = true;
|
||||
}
|
||||
|
||||
- std::optional<bool> value = ext->FindBoolByDottedPath(pref_key);
|
||||
if (!value) {
|
||||
return false;
|
||||
}
|
||||
@@ -1148,6 +1156,9 @@ void ExtensionPrefs::ClearInapplicableDi
|
||||
const DisableReasonSet kAllowDisableReasons = {
|
||||
disable_reason::DISABLE_RELOAD,
|
||||
disable_reason::DISABLE_UNSUPPORTED_REQUIREMENT,
|
||||
+ Manifest::IsUBlockComponent(component_extension_id)
|
||||
+ ? disable_reason::DISABLE_USER_ACTION
|
||||
+ : disable_reason::DISABLE_RELOAD,
|
||||
disable_reason::DISABLE_CORRUPTED, disable_reason::DISABLE_REINSTALL};
|
||||
|
||||
const base::flat_set<int> current_disable_reasons =
|
||||
@@ -2236,6 +2247,7 @@ void ExtensionPrefs::RegisterProfilePref
|
||||
user_prefs::PrefRegistrySyncable* registry) {
|
||||
registry->RegisterDictionaryPref(pref_names::kExtensions);
|
||||
registry->RegisterListPref(pref_names::kPinnedExtensions,
|
||||
+ base::Value::List().Append(helium::kUBlockOriginComponentId),
|
||||
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
|
||||
registry->RegisterListPref(pref_names::kDeletedComponentExtensions);
|
||||
registry->RegisterDictionaryPref(kExtensionsBlocklistUpdate);
|
||||
@@ -2300,14 +2312,14 @@ bool ExtensionPrefs::GetUserExtensionPre
|
||||
ExtensionIdContainer* id_container_out) const {
|
||||
DCHECK(id_container_out->empty());
|
||||
|
||||
- const base::Value* user_pref_value = prefs_->GetUserPrefValue(pref);
|
||||
- if (!user_pref_value || !user_pref_value->is_list()) {
|
||||
+ const base::Value& user_pref_value = prefs_->GetValue(pref);
|
||||
+ if (!user_pref_value.is_list()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
std::insert_iterator<ExtensionIdContainer> insert_iterator(
|
||||
*id_container_out, id_container_out->end());
|
||||
- for (const auto& entry : user_pref_value->GetList()) {
|
||||
+ for (const auto& entry : user_pref_value.GetList()) {
|
||||
if (!entry.is_string()) {
|
||||
NOTREACHED();
|
||||
}
|
||||
@@ -0,0 +1,350 @@
|
||||
--- /dev/null
|
||||
+++ b/third_party/ublock/README.chromium
|
||||
@@ -0,0 +1,14 @@
|
||||
+Name: uBlock Origin
|
||||
+Short Name: ublock
|
||||
+URL: https://github.com/gorhill/uBlock
|
||||
+Version: 1.66.4
|
||||
+License: GPL-3.0
|
||||
+License File: LICENSE.txt
|
||||
+Shipped: yes
|
||||
+Security Critical: yes
|
||||
+
|
||||
+Description:
|
||||
+uBlock Origin - An efficient blocker for Chromium and Firefox. Fast and lean.
|
||||
+
|
||||
+Local Modifications:
|
||||
+Patched out remote URLs from assets.json, patched in public key into manifest
|
||||
--- /dev/null
|
||||
+++ b/third_party/ublock/BUILD.gn
|
||||
@@ -0,0 +1,50 @@
|
||||
+# Copyright 2025 The Helium Authors
|
||||
+# You can use, redistribute, and/or modify this source code under
|
||||
+# the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
+
|
||||
+import("//ui/webui/resources/tools/generate_grd.gni")
|
||||
+import("//tools/grit/grit_rule.gni")
|
||||
+
|
||||
+file_list = "$target_gen_dir/files.json"
|
||||
+generated_grd = "$target_gen_dir/ublock_resources.grd"
|
||||
+
|
||||
+action("generate_file_list") {
|
||||
+ script = "generate_file_list.py"
|
||||
+ args = [
|
||||
+ rebase_path("."),
|
||||
+ rebase_path(file_list),
|
||||
+ ]
|
||||
+ inputs = [
|
||||
+ "manifest.json",
|
||||
+ "generate_file_list.py",
|
||||
+ ]
|
||||
+ outputs = [ file_list ]
|
||||
+}
|
||||
+
|
||||
+generate_grd("ublock_grd") {
|
||||
+ out_grd = generated_grd
|
||||
+
|
||||
+ grd_prefix = "ublock"
|
||||
+ resource_path_prefix = "ublock"
|
||||
+
|
||||
+ manifest_files = [ file_list ]
|
||||
+ deps = [":generate_file_list"]
|
||||
+}
|
||||
+
|
||||
+grit("ublock") {
|
||||
+ source = generated_grd
|
||||
+
|
||||
+ # Required because the .grd is generated.
|
||||
+ enable_input_discovery_for_gn_analyze = false
|
||||
+
|
||||
+ output_dir = "$target_gen_dir/resources"
|
||||
+
|
||||
+ outputs = [
|
||||
+ "grit/ublock_resources.h",
|
||||
+ "grit/ublock_resources_map.cc",
|
||||
+ "grit/ublock_resources_map.h",
|
||||
+ "ublock_resources.pak"
|
||||
+ ]
|
||||
+
|
||||
+ deps = [":ublock_grd"]
|
||||
+}
|
||||
--- /dev/null
|
||||
+++ b/third_party/ublock/generate_file_list.py
|
||||
@@ -0,0 +1,19 @@
|
||||
+# 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 json
|
||||
+from sys import argv
|
||||
+from pathlib import Path
|
||||
+
|
||||
+ublock_src = argv[1]
|
||||
+out_file = argv[2]
|
||||
+
|
||||
+with open(out_file, 'w') as f:
|
||||
+ f.write(json.dumps(
|
||||
+ { "base_dir": ublock_src,
|
||||
+ "files": [ str((root / file).relative_to(ublock_src))
|
||||
+ for root, _, files in Path(ublock_src).walk()
|
||||
+ for file in files ]
|
||||
+ }
|
||||
+ ))
|
||||
--- a/tools/gritsettings/resource_ids.spec
|
||||
+++ b/tools/gritsettings/resource_ids.spec
|
||||
@@ -196,7 +196,7 @@
|
||||
"META": {"sizes": {"includes": [500]}},
|
||||
"includes": [2850],
|
||||
},
|
||||
- "<(SHARED_INTERMEDIATE_DIR)/chrome/browser/resources/ash/settings/resources.grd": {
|
||||
+ "<(SHARED_INTERMEDIATE_DIR)/third_party/ublock/ublock_resources.grd": {
|
||||
"META": {"sizes": {"includes": [1000],}},
|
||||
"includes": [2860],
|
||||
},
|
||||
--- a/chrome/browser/extensions/BUILD.gn
|
||||
+++ b/chrome/browser/extensions/BUILD.gn
|
||||
@@ -595,6 +595,7 @@ source_set("extensions") {
|
||||
"//net:extras",
|
||||
"//services/metrics/public/cpp:ukm_builders",
|
||||
"//storage/browser",
|
||||
+ "//third_party/ublock",
|
||||
"//third_party/zlib/google:zip",
|
||||
"//ui/base/accelerators/global_accelerator_listener",
|
||||
"//ui/base/unowned_user_data",
|
||||
--- a/chrome/chrome_paks.gni
|
||||
+++ b/chrome/chrome_paks.gni
|
||||
@@ -151,6 +151,7 @@ template("chrome_extra_paks") {
|
||||
"$root_gen_dir/third_party/blink/public/resources/blink_resources.pak",
|
||||
"$root_gen_dir/third_party/blink/public/resources/inspector_overlay_resources.pak",
|
||||
"$root_gen_dir/third_party/blink/public/strings/permission_element_generated_strings.pak",
|
||||
+ "$root_gen_dir/third_party/ublock/resources/ublock_resources.pak",
|
||||
"$root_gen_dir/ui/resources/ui_lottie_resources.pak",
|
||||
"$root_gen_dir/ui/webui/resources/webui_resources.pak",
|
||||
]
|
||||
@@ -173,6 +174,7 @@ template("chrome_extra_paks") {
|
||||
"//third_party/blink/public:devtools_inspector_resources",
|
||||
"//third_party/blink/public:resources",
|
||||
"//third_party/blink/public/strings:permission_element_generated_strings",
|
||||
+ "//third_party/ublock",
|
||||
"//ui/resources:ui_lottie_resources_grd",
|
||||
"//ui/webui/resources",
|
||||
]
|
||||
--- a/chrome/browser/extensions/chrome_component_extension_resource_manager.cc
|
||||
+++ b/chrome/browser/extensions/chrome_component_extension_resource_manager.cc
|
||||
@@ -24,6 +24,7 @@
|
||||
#include "extensions/common/extension_id.h"
|
||||
#include "pdf/buildflags.h"
|
||||
#include "ui/base/resource/resource_bundle.h"
|
||||
+#include "third_party/ublock/resources/grit/ublock_resources_map.h"
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
#include "ash/keyboard/ui/resources/keyboard_resource_util.h"
|
||||
@@ -102,6 +103,7 @@ ChromeComponentExtensionResourceManager:
|
||||
|
||||
AddComponentResourceEntries(kComponentExtensionResources);
|
||||
AddComponentResourceEntries(kExtraComponentExtensionResources);
|
||||
+ AddComponentResourceEntries(kUblockResources);
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS)
|
||||
// Add Files app JS modules resources.
|
||||
--- a/third_party/ublock/manifest.json
|
||||
+++ b/third_party/ublock/manifest.json
|
||||
@@ -115,5 +115,5 @@
|
||||
"web_accessible_resources": [
|
||||
"/web_accessible_resources/*"
|
||||
],
|
||||
- "update_url": "https://raw.githubusercontent.com/imputnet/ublock-origin-crx/refs/heads/main/update.xml"
|
||||
-}
|
||||
\ No newline at end of file
|
||||
+ "key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyqQYDhKkM6NlQjOgb11DpHQHsqvK4IMPDIDhvmR47JDGOrf/UyI6+wmx9MfMuqzUBFigip+57UUr+mWoWtI4eNga1zKb8wEphTDmm0Oo0NHInSlN5t8FmUEPjJ0WVf+CiwA3ucf32OAe+1akOLtMAgHqe4jax7k/b69miKDz3gvi7lEPmP+H4XDoQ3dOSgEHyjyP4Nf7QgPPrvK2zkB+8q17T0w2bTApETDDkr45K563pxBqb7i9JmYPP+sXQEB8qDevA5BlPAYBAINFZPOO+SOPpMUguOSA/eb1mjNcfLMGwJs1Zn5ejxqT3RgceqjrN86AgpQvCVeqFtcal/LZFwIDAQAB"
|
||||
+}
|
||||
--- a/third_party/ublock/assets/assets.json
|
||||
+++ b/third_party/ublock/assets/assets.json
|
||||
@@ -3,10 +3,9 @@
|
||||
"content": "internal",
|
||||
"updateAfter": 13,
|
||||
"contentURL": [
|
||||
- "https://raw.githubusercontent.com/gorhill/uBlock/master/assets/assets.json",
|
||||
"assets/assets.json"
|
||||
],
|
||||
- "cdnURLs": [
|
||||
+ "^cdnURLs": [
|
||||
"https://ublockorigin.github.io/uAssetsCDN/ublock/assets.json",
|
||||
"https://ublockorigin.pages.dev/ublock/assets.json",
|
||||
"https://cdn.jsdelivr.net/gh/gorhill/uBlock@master/assets/assets.json",
|
||||
@@ -17,7 +16,6 @@
|
||||
"content": "internal",
|
||||
"updateAfter": 19,
|
||||
"contentURL": [
|
||||
- "https://publicsuffix.org/list/public_suffix_list.dat",
|
||||
"assets/thirdparties/publicsuffix.org/list/effective_tld_names.dat"
|
||||
]
|
||||
},
|
||||
@@ -25,10 +23,9 @@
|
||||
"content": "internal",
|
||||
"updateAfter": 29,
|
||||
"contentURL": [
|
||||
- "https://ublockorigin.github.io/uAssets/filters/badlists.txt",
|
||||
"assets/ublock/badlists.txt"
|
||||
],
|
||||
- "cdnURLs": [
|
||||
+ "^cdnURLs": [
|
||||
"https://ublockorigin.github.io/uAssetsCDN/filters/badlists.txt",
|
||||
"https://ublockorigin.pages.dev/filters/badlists.txt",
|
||||
"https://cdn.jsdelivr.net/gh/uBlockOrigin/uAssetsCDN@main/filters/badlists.txt",
|
||||
@@ -42,17 +39,16 @@
|
||||
"title": "uBlock filters – Ads",
|
||||
"tags": "ads",
|
||||
"contentURL": [
|
||||
- "https://ublockorigin.github.io/uAssets/filters/filters.txt",
|
||||
"assets/ublock/filters.min.txt",
|
||||
"assets/ublock/filters.txt"
|
||||
],
|
||||
- "cdnURLs": [
|
||||
+ "^cdnURLs": [
|
||||
"https://ublockorigin.github.io/uAssetsCDN/filters/filters.min.txt",
|
||||
"https://ublockorigin.pages.dev/filters/filters.min.txt",
|
||||
"https://cdn.jsdelivr.net/gh/uBlockOrigin/uAssetsCDN@main/filters/filters.min.txt",
|
||||
"https://cdn.statically.io/gh/uBlockOrigin/uAssetsCDN/main/filters/filters.min.txt"
|
||||
],
|
||||
- "patchURLs": [
|
||||
+ "^patchURLs": [
|
||||
"https://ublockorigin.github.io/uAssetsCDN/filters/",
|
||||
"https://ublockorigin.pages.dev/filters/"
|
||||
],
|
||||
@@ -65,17 +61,16 @@
|
||||
"title": "uBlock filters – Badware risks",
|
||||
"tags": "malware security",
|
||||
"contentURL": [
|
||||
- "https://ublockorigin.github.io/uAssets/filters/badware.txt",
|
||||
"assets/ublock/badware.min.txt",
|
||||
"assets/ublock/badware.txt"
|
||||
],
|
||||
- "cdnURLs": [
|
||||
+ "^cdnURLs": [
|
||||
"https://ublockorigin.github.io/uAssetsCDN/filters/badware.min.txt",
|
||||
"https://ublockorigin.pages.dev/filters/badware.min.txt",
|
||||
"https://cdn.jsdelivr.net/gh/uBlockOrigin/uAssetsCDN@main/filters/badware.min.txt",
|
||||
"https://cdn.statically.io/gh/uBlockOrigin/uAssetsCDN/main/filters/badware.min.txt"
|
||||
],
|
||||
- "patchURLs": [
|
||||
+ "^patchURLs": [
|
||||
"https://ublockorigin.github.io/uAssetsCDN/filters/",
|
||||
"https://ublockorigin.pages.dev/filters/"
|
||||
],
|
||||
@@ -89,17 +84,16 @@
|
||||
"title": "uBlock filters – Privacy",
|
||||
"tags": "privacy",
|
||||
"contentURL": [
|
||||
- "https://ublockorigin.github.io/uAssets/filters/privacy.txt",
|
||||
"assets/ublock/privacy.min.txt",
|
||||
"assets/ublock/privacy.txt"
|
||||
],
|
||||
- "cdnURLs": [
|
||||
+ "^cdnURLs": [
|
||||
"https://ublockorigin.github.io/uAssetsCDN/filters/privacy.min.txt",
|
||||
"https://ublockorigin.pages.dev/filters/privacy.min.txt",
|
||||
"https://cdn.jsdelivr.net/gh/uBlockOrigin/uAssetsCDN@main/filters/privacy.min.txt",
|
||||
"https://cdn.statically.io/gh/uBlockOrigin/uAssetsCDN/main/filters/privacy.min.txt"
|
||||
],
|
||||
- "patchURLs": [
|
||||
+ "^patchURLs": [
|
||||
"https://ublockorigin.github.io/uAssetsCDN/filters/",
|
||||
"https://ublockorigin.pages.dev/filters/"
|
||||
],
|
||||
@@ -111,17 +105,16 @@
|
||||
"parent": "uBlock filters",
|
||||
"title": "uBlock filters – Unbreak",
|
||||
"contentURL": [
|
||||
- "https://ublockorigin.github.io/uAssets/filters/unbreak.txt",
|
||||
"assets/ublock/unbreak.min.txt",
|
||||
"assets/ublock/unbreak.txt"
|
||||
],
|
||||
- "cdnURLs": [
|
||||
+ "^cdnURLs": [
|
||||
"https://ublockorigin.github.io/uAssetsCDN/filters/unbreak.min.txt",
|
||||
"https://ublockorigin.pages.dev/filters/unbreak.min.txt",
|
||||
"https://cdn.jsdelivr.net/gh/uBlockOrigin/uAssetsCDN@main/filters/unbreak.min.txt",
|
||||
"https://cdn.statically.io/gh/uBlockOrigin/uAssetsCDN/main/filters/unbreak.min.txt"
|
||||
],
|
||||
- "patchURLs": [
|
||||
+ "^patchURLs": [
|
||||
"https://ublockorigin.github.io/uAssetsCDN/filters/",
|
||||
"https://ublockorigin.pages.dev/filters/"
|
||||
],
|
||||
@@ -133,17 +126,16 @@
|
||||
"parent": "uBlock filters",
|
||||
"title": "uBlock filters – Quick fixes",
|
||||
"contentURL": [
|
||||
- "https://ublockorigin.github.io/uAssets/filters/quick-fixes.txt",
|
||||
"assets/ublock/quick-fixes.min.txt",
|
||||
"assets/ublock/quick-fixes.txt"
|
||||
],
|
||||
- "cdnURLs": [
|
||||
+ "^cdnURLs": [
|
||||
"https://ublockorigin.github.io/uAssetsCDN/filters/quick-fixes.min.txt",
|
||||
"https://ublockorigin.pages.dev/filters/quick-fixes.min.txt",
|
||||
"https://cdn.jsdelivr.net/gh/uBlockOrigin/uAssetsCDN@main/filters/quick-fixes.min.txt",
|
||||
"https://cdn.statically.io/gh/uBlockOrigin/uAssetsCDN/main/filters/quick-fixes.min.txt"
|
||||
],
|
||||
- "patchURLs": [
|
||||
+ "^patchURLs": [
|
||||
"https://ublockorigin.github.io/uAssetsCDN/filters/",
|
||||
"https://ublockorigin.pages.dev/filters/"
|
||||
],
|
||||
@@ -193,15 +185,14 @@
|
||||
"tags": "ads",
|
||||
"preferred": true,
|
||||
"contentURL": [
|
||||
- "https://ublockorigin.github.io/uAssets/thirdparties/easylist.txt",
|
||||
"assets/thirdparties/easylist/easylist.txt"
|
||||
],
|
||||
- "cdnURLs": [
|
||||
+ "^cdnURLs": [
|
||||
"https://cdn.jsdelivr.net/gh/uBlockOrigin/uAssetsCDN@main/thirdparties/easylist.txt",
|
||||
"https://cdn.statically.io/gh/uBlockOrigin/uAssetsCDN/main/thirdparties/easylist.txt",
|
||||
"https://ublockorigin.pages.dev/thirdparties/easylist.txt"
|
||||
],
|
||||
- "patchURLs": [
|
||||
+ "^patchURLs": [
|
||||
"https://ublockorigin.github.io/uAssetsCDN/filters/",
|
||||
"https://ublockorigin.pages.dev/filters/"
|
||||
],
|
||||
@@ -238,15 +229,14 @@
|
||||
"tags": "privacy",
|
||||
"preferred": true,
|
||||
"contentURL": [
|
||||
- "https://ublockorigin.github.io/uAssets/thirdparties/easyprivacy.txt",
|
||||
"assets/thirdparties/easylist/easyprivacy.txt"
|
||||
],
|
||||
- "cdnURLs": [
|
||||
+ "^cdnURLs": [
|
||||
"https://cdn.jsdelivr.net/gh/uBlockOrigin/uAssetsCDN@main/thirdparties/easyprivacy.txt",
|
||||
"https://cdn.statically.io/gh/uBlockOrigin/uAssetsCDN/main/thirdparties/easyprivacy.txt",
|
||||
"https://ublockorigin.pages.dev/thirdparties/easyprivacy.txt"
|
||||
],
|
||||
- "patchURLs": [
|
||||
+ "^patchURLs": [
|
||||
"https://ublockorigin.github.io/uAssetsCDN/filters/",
|
||||
"https://ublockorigin.pages.dev/filters/"
|
||||
],
|
||||
@@ -257,10 +247,9 @@
|
||||
"group": "malware",
|
||||
"title": "Online Malicious URL Blocklist",
|
||||
"contentURL": [
|
||||
- "https://malware-filter.gitlab.io/urlhaus-filter/urlhaus-filter-ag-online.txt",
|
||||
"assets/thirdparties/urlhaus-filter/urlhaus-filter-online.txt"
|
||||
],
|
||||
- "cdnURLs": [
|
||||
+ "^cdnURLs": [
|
||||
"https://curbengh.github.io/malware-filter/urlhaus-filter-ag-online.txt",
|
||||
"https://malware-filter.gitlab.io/urlhaus-filter/urlhaus-filter-ag-online.txt",
|
||||
"https://malware-filter.pages.dev/urlhaus-filter-ag-online.txt"
|
||||
@@ -540,7 +529,6 @@
|
||||
"tags": "ads privacy security",
|
||||
"preferred": true,
|
||||
"contentURL": [
|
||||
- "https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=1&mimetype=plaintext",
|
||||
"assets/thirdparties/pgl.yoyo.org/as/serverlist.txt",
|
||||
"assets/thirdparties/pgl.yoyo.org/as/serverlist"
|
||||
],
|
||||
@@ -7,7 +7,7 @@
|
||||
- 'opensource_project': 'ungoogled-chromium',
|
||||
- 'opensource_link': 'https://github.com/ungoogled-software/ungoogled-chromium'
|
||||
+ 'opensource_project': 'Helium',
|
||||
+ 'opensource_link': 'https://github.com/imputnet/helium-chromium'
|
||||
+ 'opensource_link': 'https://github.com/imputnet/helium'
|
||||
},
|
||||
escape=False)
|
||||
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
--- a/components/policy/core/common/helium_opinionated_policy_provider.cc
|
||||
+++ b/components/policy/core/common/helium_opinionated_policy_provider.cc
|
||||
@@ -25,6 +25,11 @@ void HopProvider::RefreshPolicies(Policy
|
||||
Set(policy_map, policy::key::kPasswordManagerEnabled, POLICY_LEVEL_MANDATORY, base::Value(false));
|
||||
Set(policy_map, policy::key::kPasswordManagerPasskeysEnabled, POLICY_LEVEL_MANDATORY, base::Value(false));
|
||||
|
||||
+ base::Value::List preinstalled_extensions;
|
||||
+ preinstalled_extensions.Append("cjpalhdlnbpafiamejdnhcphjbkeiagm"); // uBlock Origin
|
||||
+ Set(policy_map, key::kExtensionInstallForcelist, POLICY_LEVEL_RECOMMENDED,
|
||||
+ base::Value(std::move(preinstalled_extensions)));
|
||||
+
|
||||
UpdatePolicy(std::move(bundle));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,14 @@
|
||||
--- a/chrome/app/settings_strings.grdp
|
||||
+++ b/chrome/app/settings_strings.grdp
|
||||
@@ -240,7 +240,7 @@
|
||||
<message name="IDS_SETTINGS_RESET_TO_DEFAULT" desc="Name of the control which resets a browser setting back to the default value">
|
||||
Reset to default
|
||||
</message>
|
||||
- <if expr="not is_linux">
|
||||
+ <if expr="True">
|
||||
<message name="IDS_SETTINGS_RESET_TO_DEFAULT_THEME" desc="Accessibility label of the button which resets the browser theme back to the default value">
|
||||
Reset to default theme
|
||||
</message>
|
||||
@@ -269,6 +269,9 @@
|
||||
<message name="IDS_SETTINGS_AUTO_PIN_NEW_TAB_GROUPS" desc="Label for the checkbox which enables or disables auto pin new tab groups.">
|
||||
Automatically pin new tab groups created on any device to the bookmarks bar
|
||||
@@ -21,6 +30,16 @@
|
||||
{"hoverCardTitle", IDS_SETTINGS_HOVER_CARD_TITLE},
|
||||
{"showHoverCardImages", IDS_SETTINGS_SHOW_HOVER_CARD_IMAGES},
|
||||
{"showHoverCardMemoryUsage", IDS_SETTINGS_SHOW_HOVER_CARD_MEMORY_USAGE},
|
||||
@@ -553,9 +553,7 @@ void AddAppearanceStrings(content::WebUI
|
||||
{"classicTheme", IDS_SETTINGS_CLASSIC_THEME},
|
||||
{"useClassicTheme", IDS_SETTINGS_USE_CLASSIC_THEME},
|
||||
#endif
|
||||
-#if !BUILDFLAG(IS_LINUX)
|
||||
{"resetToDefaultTheme", IDS_SETTINGS_RESET_TO_DEFAULT_THEME},
|
||||
-#endif
|
||||
{"resetToolbarToDefault", IDS_SETTINGS_RESET_TOOLBAR_TO_DEFAULT},
|
||||
#if BUILDFLAG(IS_LINUX)
|
||||
{"showWindowDecorations", IDS_SHOW_WINDOW_DECORATIONS},
|
||||
--- a/chrome/browser/resources/settings/appearance_page/appearance_page.html
|
||||
+++ b/chrome/browser/resources/settings/appearance_page/appearance_page.html
|
||||
@@ -46,7 +46,6 @@
|
||||
|
||||
@@ -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>
|
||||
@@ -3154,6 +3157,9 @@
|
||||
@@ -3160,6 +3163,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.
|
||||
@@ -2681,7 +2681,7 @@ void AddSiteSettingsStrings(content::Web
|
||||
@@ -2685,7 +2685,7 @@ void AddSiteSettingsStrings(content::Web
|
||||
{"trackingProtectionSitesAllowedCookiesTitle",
|
||||
IDS_SETTINGS_TRACKING_PROTECTION_SITES_ALLOWED_COOKIES_TITLE},
|
||||
{"trackingProtectionSitesAllowedCookiesDescription",
|
||||
|
||||
@@ -36,3 +36,22 @@
|
||||
</settings-safety-hub-module>
|
||||
</template>
|
||||
<div class="cr-row first">
|
||||
--- a/chrome/browser/resources/settings/privacy_page/privacy_page_index.html
|
||||
+++ b/chrome/browser/resources/settings/privacy_page/privacy_page_index.html
|
||||
@@ -22,16 +22,6 @@
|
||||
</settings-section>
|
||||
</template>
|
||||
|
||||
- <template is="dom-if" if="[[showPage_(pageVisibility_.safetyHub)]]">
|
||||
- <template is="dom-if" if="[[renderView_(
|
||||
- routes_.PRIVACY, currentRoute, inSearchMode)]]">
|
||||
- <settings-section slot="view" id="safetyHubEntryPoint"
|
||||
- page-title="$i18n{safetyHub}">
|
||||
- <settings-safety-hub-entry-point></settings-safety-hub-entry-point>
|
||||
- </settings-section>
|
||||
- </template>
|
||||
- </template>
|
||||
-
|
||||
<template is="dom-if" if="[[renderOldView_(currentRoute, inSearchMode)]]">
|
||||
<!-- TODO(crbug.com/424223101): Remove <settings-basic-page> once all UIs
|
||||
have been migrated to standalone views. -->
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
#include "third_party/omnibox_proto/types.pb.h"
|
||||
|
||||
class ClipboardProvider;
|
||||
@@ -551,6 +552,8 @@ class AutocompleteController : public Au
|
||||
@@ -553,6 +554,8 @@ class AutocompleteController : public Au
|
||||
// A list of all providers.
|
||||
Providers providers_;
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
raw_ptr<HistoryQuickProvider> history_quick_provider_;
|
||||
--- a/components/omnibox/browser/autocomplete_controller.cc
|
||||
+++ b/components/omnibox/browser/autocomplete_controller.cc
|
||||
@@ -92,6 +92,7 @@
|
||||
@@ -94,6 +94,7 @@
|
||||
#include "components/optimization_guide/machine_learning_tflite_buildflags.h"
|
||||
#include "components/search_engines/search_engine_type.h"
|
||||
#include "components/search_engines/template_url.h"
|
||||
@@ -59,7 +59,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"
|
||||
@@ -1914,7 +1915,21 @@ void AutocompleteController::UpdateKeywo
|
||||
@@ -1916,7 +1917,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();
|
||||
|
||||
@@ -0,0 +1,463 @@
|
||||
--- a/ui/color/ref_color_mixer.cc
|
||||
+++ b/ui/color/ref_color_mixer.cc
|
||||
@@ -25,107 +25,107 @@ namespace ui {
|
||||
void AddBaselinePalette(ColorProvider* provider) {
|
||||
ColorMixer& mixer = provider->AddMixer();
|
||||
mixer[kColorRefPrimary0] = {SkColorSetRGB(0x00, 0x00, 0x00)};
|
||||
- mixer[kColorRefPrimary10] = {SkColorSetRGB(0x04, 0x1E, 0x49)};
|
||||
- mixer[kColorRefPrimary20] = {SkColorSetRGB(0x06, 0x2E, 0x6F)};
|
||||
- mixer[kColorRefPrimary25] = {SkColorSetRGB(0x07, 0x38, 0x88)};
|
||||
- mixer[kColorRefPrimary30] = {SkColorSetRGB(0x08, 0x42, 0xA0)};
|
||||
- mixer[kColorRefPrimary40] = {SkColorSetRGB(0x0B, 0x57, 0xD0)};
|
||||
- mixer[kColorRefPrimary50] = {SkColorSetRGB(0x1B, 0x6E, 0xF3)};
|
||||
- mixer[kColorRefPrimary60] = {SkColorSetRGB(0x4C, 0x8D, 0xF6)};
|
||||
- mixer[kColorRefPrimary70] = {SkColorSetRGB(0x7C, 0xAC, 0xF8)};
|
||||
- mixer[kColorRefPrimary80] = {SkColorSetRGB(0xA8, 0xC7, 0xFA)};
|
||||
- mixer[kColorRefPrimary90] = {SkColorSetRGB(0xD3, 0xE3, 0xFD)};
|
||||
- mixer[kColorRefPrimary95] = {SkColorSetRGB(0xEC, 0xF3, 0xFE)};
|
||||
- mixer[kColorRefPrimary99] = {SkColorSetRGB(0xFA, 0xFB, 0xFF)};
|
||||
+ mixer[kColorRefPrimary10] = {SkColorSetRGB(0x00, 0x12, 0x56)};
|
||||
+ mixer[kColorRefPrimary20] = {SkColorSetRGB(0x00, 0x23, 0x89)};
|
||||
+ mixer[kColorRefPrimary25] = {SkColorSetRGB(0x02, 0x2C, 0xA3)};
|
||||
+ mixer[kColorRefPrimary30] = {SkColorSetRGB(0x1A, 0x39, 0xAE)};
|
||||
+ mixer[kColorRefPrimary40] = {SkColorSetRGB(0x39, 0x54, 0xC6)};
|
||||
+ mixer[kColorRefPrimary50] = {SkColorSetRGB(0x54, 0x6E, 0xE1)};
|
||||
+ mixer[kColorRefPrimary60] = {SkColorSetRGB(0x6F, 0x88, 0xFD)};
|
||||
+ mixer[kColorRefPrimary70] = {SkColorSetRGB(0x94, 0xA6, 0xFF)};
|
||||
+ mixer[kColorRefPrimary80] = {SkColorSetRGB(0xB9, 0xC3, 0xFF)};
|
||||
+ mixer[kColorRefPrimary90] = {SkColorSetRGB(0xDD, 0xE1, 0xFF)};
|
||||
+ mixer[kColorRefPrimary95] = {SkColorSetRGB(0xF0, 0xEF, 0xFF)};
|
||||
+ mixer[kColorRefPrimary99] = {SkColorSetRGB(0xFE, 0xFB, 0xFF)};
|
||||
mixer[kColorRefPrimary100] = {SkColorSetRGB(0xFF, 0xFF, 0xFF)};
|
||||
|
||||
mixer[kColorRefSecondary0] = {SkColorSetRGB(0x00, 0x00, 0x00)};
|
||||
- mixer[kColorRefSecondary10] = {SkColorSetRGB(0x00, 0x1D, 0x35)};
|
||||
- mixer[kColorRefSecondary12] = {SkColorSetRGB(0x00, 0x22, 0x38)};
|
||||
- mixer[kColorRefSecondary15] = {SkColorSetRGB(0x00, 0x28, 0x45)};
|
||||
- mixer[kColorRefSecondary20] = {SkColorSetRGB(0x00, 0x33, 0x55)};
|
||||
- mixer[kColorRefSecondary25] = {SkColorSetRGB(0x00, 0x3f, 0x66)};
|
||||
- mixer[kColorRefSecondary30] = {SkColorSetRGB(0x00, 0x4A, 0x77)};
|
||||
- mixer[kColorRefSecondary35] = {SkColorSetRGB(0x00, 0x57, 0x89)};
|
||||
- mixer[kColorRefSecondary40] = {SkColorSetRGB(0x00, 0x63, 0x9B)};
|
||||
- mixer[kColorRefSecondary50] = {SkColorSetRGB(0x04, 0x7D, 0xB7)};
|
||||
- mixer[kColorRefSecondary60] = {SkColorSetRGB(0x39, 0x98, 0xD3)};
|
||||
- mixer[kColorRefSecondary70] = {SkColorSetRGB(0x5A, 0xB3, 0xF0)};
|
||||
- mixer[kColorRefSecondary80] = {SkColorSetRGB(0x7F, 0xCF, 0xFF)};
|
||||
- mixer[kColorRefSecondary90] = {SkColorSetRGB(0xC2, 0xE7, 0xFF)};
|
||||
- mixer[kColorRefSecondary95] = {SkColorSetRGB(0xDF, 0xF3, 0xFF)};
|
||||
- mixer[kColorRefSecondary99] = {SkColorSetRGB(0xF7, 0xFC, 0xFF)};
|
||||
+ mixer[kColorRefSecondary10] = {SkColorSetRGB(0x17, 0x1B, 0x2C)};
|
||||
+ mixer[kColorRefSecondary12] = {SkColorSetRGB(0x1B, 0x1F, 0x30)};
|
||||
+ mixer[kColorRefSecondary15] = {SkColorSetRGB(0x21, 0x25, 0x37)};
|
||||
+ mixer[kColorRefSecondary20] = {SkColorSetRGB(0x2C, 0x2F, 0x42)};
|
||||
+ mixer[kColorRefSecondary25] = {SkColorSetRGB(0x37, 0x3A, 0x4D)};
|
||||
+ mixer[kColorRefSecondary30] = {SkColorSetRGB(0x42, 0x46, 0x59)};
|
||||
+ mixer[kColorRefSecondary35] = {SkColorSetRGB(0x4E, 0x51, 0x65)};
|
||||
+ mixer[kColorRefSecondary40] = {SkColorSetRGB(0x5A, 0x5D, 0x72)};
|
||||
+ mixer[kColorRefSecondary50] = {SkColorSetRGB(0x73, 0x76, 0x8B)};
|
||||
+ mixer[kColorRefSecondary60] = {SkColorSetRGB(0x8D, 0x8F, 0xA6)};
|
||||
+ mixer[kColorRefSecondary70] = {SkColorSetRGB(0xA7, 0xAA, 0xC1)};
|
||||
+ mixer[kColorRefSecondary80] = {SkColorSetRGB(0xC3, 0xC5, 0xDD)};
|
||||
+ mixer[kColorRefSecondary90] = {SkColorSetRGB(0xDF, 0xE1, 0xF9)};
|
||||
+ mixer[kColorRefSecondary95] = {SkColorSetRGB(0xF0, 0xEF, 0xFF)};
|
||||
+ mixer[kColorRefSecondary99] = {SkColorSetRGB(0xFE, 0xFB, 0xFF)};
|
||||
mixer[kColorRefSecondary100] = {SkColorSetRGB(0xFF, 0xFF, 0xFF)};
|
||||
|
||||
mixer[kColorRefTertiary0] = {SkColorSetRGB(0x00, 0x00, 0x00)};
|
||||
- mixer[kColorRefTertiary10] = {SkColorSetRGB(0x07, 0x27, 0x11)};
|
||||
- mixer[kColorRefTertiary20] = {SkColorSetRGB(0x0A, 0x38, 0x18)};
|
||||
- mixer[kColorRefTertiary30] = {SkColorSetRGB(0x0F, 0x52, 0x23)};
|
||||
- mixer[kColorRefTertiary40] = {SkColorSetRGB(0x14, 0x6C, 0x2E)};
|
||||
- mixer[kColorRefTertiary50] = {SkColorSetRGB(0x19, 0x86, 0x39)};
|
||||
- mixer[kColorRefTertiary60] = {SkColorSetRGB(0x1E, 0xA4, 0x46)};
|
||||
- mixer[kColorRefTertiary70] = {SkColorSetRGB(0x37, 0xBE, 0x5F)};
|
||||
- mixer[kColorRefTertiary80] = {SkColorSetRGB(0x6D, 0xD5, 0x8C)};
|
||||
- mixer[kColorRefTertiary90] = {SkColorSetRGB(0xC4, 0xEE, 0xD0)};
|
||||
- mixer[kColorRefTertiary95] = {SkColorSetRGB(0xE7, 0xF8, 0xED)};
|
||||
- mixer[kColorRefTertiary99] = {SkColorSetRGB(0xF2, 0xFF, 0xEE)};
|
||||
+ mixer[kColorRefTertiary10] = {SkColorSetRGB(0x13, 0x1A, 0x33)};
|
||||
+ mixer[kColorRefTertiary20] = {SkColorSetRGB(0x28, 0x2F, 0x49)};
|
||||
+ mixer[kColorRefTertiary30] = {SkColorSetRGB(0x3E, 0x46, 0x61)};
|
||||
+ mixer[kColorRefTertiary40] = {SkColorSetRGB(0x56, 0x5D, 0x7A)};
|
||||
+ mixer[kColorRefTertiary50] = {SkColorSetRGB(0x6F, 0x76, 0x94)};
|
||||
+ mixer[kColorRefTertiary60] = {SkColorSetRGB(0x88, 0x8F, 0xAE)};
|
||||
+ mixer[kColorRefTertiary70] = {SkColorSetRGB(0xA3, 0xAA, 0xCA)};
|
||||
+ mixer[kColorRefTertiary80] = {SkColorSetRGB(0xBE, 0xC5, 0xE6)};
|
||||
+ mixer[kColorRefTertiary90] = {SkColorSetRGB(0xDC, 0xE1, 0xFF)};
|
||||
+ mixer[kColorRefTertiary95] = {SkColorSetRGB(0xEF, 0xF0, 0xFF)};
|
||||
+ mixer[kColorRefTertiary99] = {SkColorSetRGB(0xFE, 0xFB, 0xFF)};
|
||||
mixer[kColorRefTertiary100] = {SkColorSetRGB(0xFF, 0xFF, 0xFF)};
|
||||
|
||||
mixer[kColorRefError0] = {SkColorSetRGB(0x00, 0x00, 0x00)};
|
||||
- mixer[kColorRefError10] = {SkColorSetRGB(0x41, 0x0E, 0x0B)};
|
||||
- mixer[kColorRefError20] = {SkColorSetRGB(0x60, 0x14, 0x10)};
|
||||
- mixer[kColorRefError30] = {SkColorSetRGB(0x8C, 0x1D, 0x18)};
|
||||
- mixer[kColorRefError40] = {SkColorSetRGB(0xB3, 0x26, 0x1E)};
|
||||
- mixer[kColorRefError50] = {SkColorSetRGB(0xDC, 0x36, 0x2E)};
|
||||
- mixer[kColorRefError60] = {SkColorSetRGB(0xE4, 0x69, 0x62)};
|
||||
- mixer[kColorRefError70] = {SkColorSetRGB(0xEC, 0x92, 0x8E)};
|
||||
- mixer[kColorRefError80] = {SkColorSetRGB(0xF2, 0xB8, 0xB5)};
|
||||
- mixer[kColorRefError90] = {SkColorSetRGB(0xF9, 0xDE, 0xDC)};
|
||||
- mixer[kColorRefError95] = {SkColorSetRGB(0xFC, 0xEE, 0xEE)};
|
||||
- mixer[kColorRefError99] = {SkColorSetRGB(0xFF, 0xFB, 0xF9)};
|
||||
+ mixer[kColorRefError10] = {SkColorSetRGB(0x41, 0x00, 0x02)};
|
||||
+ mixer[kColorRefError20] = {SkColorSetRGB(0x69, 0x00, 0x05)};
|
||||
+ mixer[kColorRefError30] = {SkColorSetRGB(0x93, 0x00, 0x0A)};
|
||||
+ mixer[kColorRefError40] = {SkColorSetRGB(0xBA, 0x1A, 0x1A)};
|
||||
+ mixer[kColorRefError50] = {SkColorSetRGB(0xDE, 0x37, 0x30)};
|
||||
+ mixer[kColorRefError60] = {SkColorSetRGB(0xFF, 0x54, 0x49)};
|
||||
+ mixer[kColorRefError70] = {SkColorSetRGB(0xFF, 0x89, 0x7D)};
|
||||
+ mixer[kColorRefError80] = {SkColorSetRGB(0xFF, 0xB4, 0xAB)};
|
||||
+ mixer[kColorRefError90] = {SkColorSetRGB(0xFF, 0xDA, 0xD6)};
|
||||
+ mixer[kColorRefError95] = {SkColorSetRGB(0xFF, 0xED, 0xEA)};
|
||||
+ mixer[kColorRefError99] = {SkColorSetRGB(0xFF, 0xFB, 0xFF)};
|
||||
mixer[kColorRefError100] = {SkColorSetRGB(0xFF, 0xFF, 0xFF)};
|
||||
|
||||
mixer[kColorRefNeutral0] = {SkColorSetRGB(0x00, 0x00, 0x00)};
|
||||
- mixer[kColorRefNeutral4] = {SkColorSetRGB(0x0E, 0x0E, 0x0F)};
|
||||
- mixer[kColorRefNeutral6] = {SkColorSetRGB(0x13, 0x13, 0x14)};
|
||||
- mixer[kColorRefNeutral8] = {SkColorSetRGB(0x16, 0x18, 0x18)};
|
||||
- mixer[kColorRefNeutral10] = {SkColorSetRGB(0x1F, 0x1F, 0x1F)};
|
||||
- mixer[kColorRefNeutral12] = {SkColorSetRGB(0x1F, 0x20, 0x20)};
|
||||
- mixer[kColorRefNeutral15] = {SkColorSetRGB(0x28, 0x28, 0x28)};
|
||||
- mixer[kColorRefNeutral17] = {SkColorSetRGB(0x2A, 0x2A, 0x2A)};
|
||||
- mixer[kColorRefNeutral20] = {SkColorSetRGB(0x30, 0x30, 0x30)};
|
||||
- mixer[kColorRefNeutral22] = {SkColorSetRGB(0x34, 0x35, 0x35)};
|
||||
- mixer[kColorRefNeutral24] = {SkColorSetRGB(0x39, 0x39, 0x39)};
|
||||
- mixer[kColorRefNeutral25] = {SkColorSetRGB(0x3c, 0x3c, 0x3c)};
|
||||
- mixer[kColorRefNeutral30] = {SkColorSetRGB(0x47, 0x47, 0x47)};
|
||||
- mixer[kColorRefNeutral40] = {SkColorSetRGB(0x5E, 0x5E, 0x5E)};
|
||||
- mixer[kColorRefNeutral50] = {SkColorSetRGB(0x75, 0x75, 0x75)};
|
||||
- mixer[kColorRefNeutral60] = {SkColorSetRGB(0x8F, 0x8F, 0x8F)};
|
||||
- mixer[kColorRefNeutral70] = {SkColorSetRGB(0xAB, 0xAB, 0xAB)};
|
||||
- mixer[kColorRefNeutral80] = {SkColorSetRGB(0xC7, 0xC7, 0xC7)};
|
||||
- mixer[kColorRefNeutral87] = {SkColorSetRGB(0xDA, 0xDA, 0xDA)};
|
||||
- mixer[kColorRefNeutral90] = {SkColorSetRGB(0xE3, 0xE3, 0xE3)};
|
||||
- mixer[kColorRefNeutral92] = {SkColorSetRGB(0xE9, 0xE8, 0xE8)};
|
||||
- mixer[kColorRefNeutral94] = {SkColorSetRGB(0xEF, 0xED, 0xED)};
|
||||
- mixer[kColorRefNeutral95] = {SkColorSetRGB(0xF2, 0xF2, 0xF2)};
|
||||
- mixer[kColorRefNeutral96] = {SkColorSetRGB(0xF4, 0xF3, 0xF2)};
|
||||
- mixer[kColorRefNeutral98] = {SkColorSetRGB(0xFA, 0xF9, 0xF8)};
|
||||
- mixer[kColorRefNeutral99] = {SkColorSetRGB(0xFD, 0xFC, 0xFB)};
|
||||
+ mixer[kColorRefNeutral4] = {SkColorSetRGB(0x0C, 0x0E, 0x14)};
|
||||
+ mixer[kColorRefNeutral6] = {SkColorSetRGB(0x11, 0x13, 0x19)};
|
||||
+ mixer[kColorRefNeutral8] = {SkColorSetRGB(0x15, 0x17, 0x1E)};
|
||||
+ mixer[kColorRefNeutral10] = {SkColorSetRGB(0x19, 0x1B, 0x22)};
|
||||
+ mixer[kColorRefNeutral12] = {SkColorSetRGB(0x1D, 0x1F, 0x26)};
|
||||
+ mixer[kColorRefNeutral15] = {SkColorSetRGB(0x24, 0x26, 0x2C)};
|
||||
+ mixer[kColorRefNeutral17] = {SkColorSetRGB(0x28, 0x2A, 0x30)};
|
||||
+ mixer[kColorRefNeutral20] = {SkColorSetRGB(0x2E, 0x30, 0x37)};
|
||||
+ mixer[kColorRefNeutral22] = {SkColorSetRGB(0x33, 0x35, 0x3B)};
|
||||
+ mixer[kColorRefNeutral24] = {SkColorSetRGB(0x37, 0x39, 0x40)};
|
||||
+ mixer[kColorRefNeutral25] = {SkColorSetRGB(0x39, 0x3B, 0x42)};
|
||||
+ mixer[kColorRefNeutral30] = {SkColorSetRGB(0x45, 0x46, 0x4D)};
|
||||
+ mixer[kColorRefNeutral40] = {SkColorSetRGB(0x5D, 0x5E, 0x65)};
|
||||
+ mixer[kColorRefNeutral50] = {SkColorSetRGB(0x75, 0x77, 0x7E)};
|
||||
+ mixer[kColorRefNeutral60] = {SkColorSetRGB(0x8F, 0x90, 0x98)};
|
||||
+ mixer[kColorRefNeutral70] = {SkColorSetRGB(0xAA, 0xAB, 0xB3)};
|
||||
+ mixer[kColorRefNeutral80] = {SkColorSetRGB(0xC5, 0xC6, 0xCE)};
|
||||
+ mixer[kColorRefNeutral87] = {SkColorSetRGB(0xD9, 0xD9, 0xE2)};
|
||||
+ mixer[kColorRefNeutral90] = {SkColorSetRGB(0xE2, 0xE2, 0xEA)};
|
||||
+ mixer[kColorRefNeutral92] = {SkColorSetRGB(0xE7, 0xE7, 0xF0)};
|
||||
+ mixer[kColorRefNeutral94] = {SkColorSetRGB(0xED, 0xED, 0xF6)};
|
||||
+ mixer[kColorRefNeutral95] = {SkColorSetRGB(0xF0, 0xF0, 0xF9)};
|
||||
+ mixer[kColorRefNeutral96] = {SkColorSetRGB(0xF3, 0xF3, 0xFC)};
|
||||
+ mixer[kColorRefNeutral98] = {SkColorSetRGB(0xFA, 0xF8, 0xFF)};
|
||||
+ mixer[kColorRefNeutral99] = {SkColorSetRGB(0xFE, 0xFB, 0xFF)};
|
||||
mixer[kColorRefNeutral100] = {SkColorSetRGB(0xFF, 0xFF, 0xFF)};
|
||||
|
||||
mixer[kColorRefNeutralVariant0] = {SkColorSetRGB(0x00, 0x00, 0x00)};
|
||||
- mixer[kColorRefNeutralVariant10] = {SkColorSetRGB(0x19, 0x1D, 0x1C)};
|
||||
- mixer[kColorRefNeutralVariant15] = {SkColorSetRGB(0x23, 0x27, 0x26)};
|
||||
- mixer[kColorRefNeutralVariant20] = {SkColorSetRGB(0x2D, 0x31, 0x2F)};
|
||||
- mixer[kColorRefNeutralVariant30] = {SkColorSetRGB(0x44, 0x47, 0x46)};
|
||||
- mixer[kColorRefNeutralVariant40] = {SkColorSetRGB(0x5C, 0x5F, 0x5E)};
|
||||
- mixer[kColorRefNeutralVariant50] = {SkColorSetRGB(0x74, 0x77, 0x75)};
|
||||
- mixer[kColorRefNeutralVariant60] = {SkColorSetRGB(0x8E, 0x91, 0x8F)};
|
||||
- mixer[kColorRefNeutralVariant70] = {SkColorSetRGB(0xA9, 0xAC, 0xAA)};
|
||||
- mixer[kColorRefNeutralVariant80] = {SkColorSetRGB(0xC4, 0xC7, 0xC5)};
|
||||
- mixer[kColorRefNeutralVariant90] = {SkColorSetRGB(0xE1, 0xE3, 0xE1)};
|
||||
- mixer[kColorRefNeutralVariant95] = {SkColorSetRGB(0xEF, 0xF2, 0xEF)};
|
||||
- mixer[kColorRefNeutralVariant99] = {SkColorSetRGB(0xFA, 0xFD, 0xFB)};
|
||||
+ mixer[kColorRefNeutralVariant10] = {SkColorSetRGB(0x13, 0x1A, 0x33)};
|
||||
+ mixer[kColorRefNeutralVariant15] = {SkColorSetRGB(0x1D, 0x25, 0x3E)};
|
||||
+ mixer[kColorRefNeutralVariant20] = {SkColorSetRGB(0x28, 0x2F, 0x49)};
|
||||
+ mixer[kColorRefNeutralVariant30] = {SkColorSetRGB(0x3E, 0x46, 0x61)};
|
||||
+ mixer[kColorRefNeutralVariant40] = {SkColorSetRGB(0x56, 0x5D, 0x7A)};
|
||||
+ mixer[kColorRefNeutralVariant50] = {SkColorSetRGB(0x6F, 0x76, 0x94)};
|
||||
+ mixer[kColorRefNeutralVariant60] = {SkColorSetRGB(0x88, 0x8F, 0xAE)};
|
||||
+ mixer[kColorRefNeutralVariant70] = {SkColorSetRGB(0xA3, 0xAA, 0xCA)};
|
||||
+ mixer[kColorRefNeutralVariant80] = {SkColorSetRGB(0xBE, 0xC5, 0xE6)};
|
||||
+ mixer[kColorRefNeutralVariant90] = {SkColorSetRGB(0xDC, 0xE1, 0xFF)};
|
||||
+ mixer[kColorRefNeutralVariant95] = {SkColorSetRGB(0xEF, 0xF0, 0xFF)};
|
||||
+ mixer[kColorRefNeutralVariant99] = {SkColorSetRGB(0xFE, 0xFB, 0xFF)};
|
||||
mixer[kColorRefNeutralVariant100] = {SkColorSetRGB(0xFF, 0xFF, 0xFF)};
|
||||
}
|
||||
|
||||
--- a/ui/color/sys_color_mixer.cc
|
||||
+++ b/ui/color/sys_color_mixer.cc
|
||||
@@ -80,11 +80,11 @@ void AddGrayscaleSysColorOverrides(Color
|
||||
mixer[kColorSysOnSurfacePrimary] = {dark_mode ? kColorRefNeutral90
|
||||
: kColorRefNeutral10};
|
||||
mixer[kColorSysDivider] = {dark_mode ? kColorRefNeutral40
|
||||
- : kColorRefNeutral90};
|
||||
+ : kColorRefNeutral92};
|
||||
|
||||
// Chrome surfaces.
|
||||
mixer[kColorSysHeader] = {dark_mode ? kColorRefNeutral12
|
||||
- : kColorRefNeutral90};
|
||||
+ : kColorRefNeutral92};
|
||||
mixer[kColorSysHeaderInactive] = {
|
||||
dark_mode ? AlphaBlend({kColorSysHeader}, {kColorRefNeutral25}, 0x99)
|
||||
: AlphaBlend({kColorSysHeader}, {kColorRefNeutral98}, 0x48)};
|
||||
--- a/ui/gfx/color_palette.h
|
||||
+++ b/ui/gfx/color_palette.h
|
||||
@@ -15,16 +15,16 @@ constexpr SkColor kPlaceholderColor = SK
|
||||
|
||||
// The number refers to the shade of darkness. Each color in the MD
|
||||
// palette ranges from 050-900.
|
||||
-constexpr SkColor kGoogleBlue050 = SkColorSetRGB(0xE8, 0xF0, 0xFE);
|
||||
-constexpr SkColor kGoogleBlue100 = SkColorSetRGB(0xD2, 0xE3, 0xFC);
|
||||
-constexpr SkColor kGoogleBlue200 = SkColorSetRGB(0xAE, 0xCB, 0xFA);
|
||||
-constexpr SkColor kGoogleBlue300 = SkColorSetRGB(0x8A, 0xB4, 0xF8);
|
||||
-constexpr SkColor kGoogleBlue400 = SkColorSetRGB(0x66, 0x9D, 0xF6);
|
||||
-constexpr SkColor kGoogleBlue500 = SkColorSetRGB(0x42, 0x85, 0xF4);
|
||||
-constexpr SkColor kGoogleBlue600 = SkColorSetRGB(0x1A, 0x73, 0xE8);
|
||||
-constexpr SkColor kGoogleBlue700 = SkColorSetRGB(0x19, 0x67, 0xD2);
|
||||
-constexpr SkColor kGoogleBlue800 = SkColorSetRGB(0x18, 0x5A, 0xBC);
|
||||
-constexpr SkColor kGoogleBlue900 = SkColorSetRGB(0x17, 0x4E, 0xA6);
|
||||
+constexpr SkColor kGoogleBlue050 = SkColorSetRGB(0xEF, 0xF5, 0xFF);
|
||||
+constexpr SkColor kGoogleBlue100 = SkColorSetRGB(0xE3, 0xED, 0xFF);
|
||||
+constexpr SkColor kGoogleBlue200 = SkColorSetRGB(0xCE, 0xDD, 0xFF);
|
||||
+constexpr SkColor kGoogleBlue300 = SkColorSetRGB(0xB4, 0xC9, 0xFF);
|
||||
+constexpr SkColor kGoogleBlue400 = SkColorSetRGB(0x97, 0xB1, 0xFF);
|
||||
+constexpr SkColor kGoogleBlue500 = SkColorSetRGB(0x7A, 0x97, 0xFB);
|
||||
+constexpr SkColor kGoogleBlue600 = SkColorSetRGB(0x5E, 0x7A, 0xE8);
|
||||
+constexpr SkColor kGoogleBlue700 = SkColorSetRGB(0x43, 0x5B, 0xCD);
|
||||
+constexpr SkColor kGoogleBlue800 = SkColorSetRGB(0x2C, 0x3D, 0xA9);
|
||||
+constexpr SkColor kGoogleBlue900 = SkColorSetRGB(0x18, 0x20, 0x7C);
|
||||
|
||||
constexpr SkColor kGoogleRed050 = SkColorSetRGB(0xFC, 0xE8, 0xE6);
|
||||
constexpr SkColor kGoogleRed100 = SkColorSetRGB(0xFA, 0xD2, 0xCF);
|
||||
--- a/ui/webui/resources/cr_elements/cr_shared_vars.css
|
||||
+++ b/ui/webui/resources/cr_elements/cr_shared_vars.css
|
||||
@@ -9,25 +9,26 @@
|
||||
|
||||
/* Common css variables for Material Design WebUI */
|
||||
html {
|
||||
- --google-blue-50-rgb: 232, 240, 254; /* #e8f0fe */
|
||||
+ --helium-blue: #4c66d9;
|
||||
+ --google-blue-50-rgb: 239, 245, 255; /* #eff5ff */
|
||||
--google-blue-50: rgb(var(--google-blue-50-rgb));
|
||||
- --google-blue-100-rgb: 210, 227, 252; /* #d2e3fc */
|
||||
+ --google-blue-100-rgb: 227, 237, 255; /* #e3edff */
|
||||
--google-blue-100: rgb(var(--google-blue-100-rgb));
|
||||
- --google-blue-200-rgb: 174, 203, 250; /* #aecbfa */
|
||||
+ --google-blue-200-rgb: 206, 221, 255; /* #ceddff */
|
||||
--google-blue-200: rgb(var(--google-blue-200-rgb));
|
||||
- --google-blue-300-rgb: 138, 180, 248; /* #8ab4f8 */
|
||||
+ --google-blue-300-rgb: 180, 201, 255; /* #b4c9ff */
|
||||
--google-blue-300: rgb(var(--google-blue-300-rgb));
|
||||
- --google-blue-400-rgb: 102, 157, 246; /* #669df6 */
|
||||
+ --google-blue-400-rgb: 151, 177, 255; /* #97b1ff */
|
||||
--google-blue-400: rgb(var(--google-blue-400-rgb));
|
||||
- --google-blue-500-rgb: 66, 133, 244; /* #4285f4 */
|
||||
+ --google-blue-500-rgb: 122, 151, 251; /* #7a97fb */
|
||||
--google-blue-500: rgb(var(--google-blue-500-rgb));
|
||||
- --google-blue-600-rgb: 26, 115, 232; /* #1a73e8 */
|
||||
+ --google-blue-600-rgb: 94, 122, 232; /* #5e7ae8 */
|
||||
--google-blue-600: rgb(var(--google-blue-600-rgb));
|
||||
- --google-blue-700-rgb: 25, 103, 210; /* #1967d2 */
|
||||
+ --google-blue-700-rgb: 67, 91, 205; /* #435bcd */
|
||||
--google-blue-700: rgb(var(--google-blue-700-rgb));
|
||||
- --google-blue-800-rgb: 24, 90, 188; /* #185abc */
|
||||
+ --google-blue-800-rgb: 44, 61, 169; /* #2c3da9 */
|
||||
--google-blue-800: rgb(var(--google-blue-800-rgb));
|
||||
- --google-blue-900-rgb: 23, 78, 166; /* #174ea6 */
|
||||
+ --google-blue-900-rgb: 24, 32, 124; /* #18207c */
|
||||
--google-blue-900: rgb(var(--google-blue-900-rgb));
|
||||
|
||||
--google-green-50-rgb: 230, 244, 234; /* #e6f4ea */
|
||||
@@ -236,14 +237,14 @@ html {
|
||||
the color pipeline. */
|
||||
--cr-fallback-color-outline: rgb(116, 119, 117);
|
||||
|
||||
- --cr-fallback-color-primary: rgb(11, 87, 208);
|
||||
+ --cr-fallback-color-primary: var(--helium-blue);
|
||||
--cr-fallback-color-on-primary: rgb(255, 255, 255);
|
||||
|
||||
- --cr-fallback-color-primary-container: rgb(211, 227, 253);
|
||||
- --cr-fallback-color-on-primary-container: rgb(4, 30, 73);
|
||||
+ --cr-fallback-color-primary-container: var(--google-blue-200);
|
||||
+ --cr-fallback-color-on-primary-container: var(--google-blue-900);
|
||||
|
||||
- --cr-fallback-color-secondary-container: rgb(194, 231, 255);
|
||||
- --cr-fallback-color-on-secondary-container: rgb(0, 29, 53);
|
||||
+ --cr-fallback-color-secondary-container: var(--google-blue-300);
|
||||
+ --cr-fallback-color-on-secondary-container: var(--google-blue-900);
|
||||
|
||||
--cr-fallback-color-neutral-container: rgb(242, 242, 242);
|
||||
--cr-fallback-color-neutral-outline: rgb(199, 199, 199);
|
||||
@@ -260,18 +261,18 @@ html {
|
||||
|
||||
--cr-fallback-color-on-surface-subtle: rgb(71, 71, 71);
|
||||
|
||||
- --cr-fallback-color-inverse-primary: rgb(168, 199, 250);
|
||||
+ --cr-fallback-color-inverse-primary: var(--google-blue-400);
|
||||
--cr-fallback-color-inverse-surface: rgb(48, 48, 48);
|
||||
--cr-fallback-color-inverse-on-surface: rgb(242, 242, 242);
|
||||
|
||||
- --cr-fallback-color-tonal-container: rgb(211, 227, 253);
|
||||
- --cr-fallback-color-on-tonal-container: rgb(4, 30, 73);
|
||||
+ --cr-fallback-color-tonal-container: var(--google-blue-200);
|
||||
+ --cr-fallback-color-on-tonal-container: var(--google-blue-900);
|
||||
|
||||
- --cr-fallback-color-tonal-outline: rgb(168, 199, 250);
|
||||
+ --cr-fallback-color-tonal-outline: var(--google-blue-400);
|
||||
|
||||
--cr-fallback-color-error: rgb(179, 38, 30);
|
||||
|
||||
- --cr-fallback-color-divider: rgb(211, 227, 253);
|
||||
+ --cr-fallback-color-divider: var(--google-blue-200);
|
||||
|
||||
--cr-fallback-color-state-hover-on-prominent_: rgba(253, 252, 251, .1);
|
||||
|
||||
@@ -284,7 +285,7 @@ html {
|
||||
--cr-fallback-color-state-ripple-primary_: rgba(
|
||||
var(--cr-fallback-color-state-ripple-primary-rgb_), 0.32);
|
||||
|
||||
- --cr-fallback-color-base-container: rgb(236, 239, 247);
|
||||
+ --cr-fallback-color-base-container: var(--google-grey-100);
|
||||
|
||||
--cr-fallback-color-disabled-background: rgba(
|
||||
var(--cr-fallback-color-on-surface-rgb), .12);
|
||||
@@ -339,12 +340,12 @@ html {
|
||||
html {
|
||||
/* Colors */
|
||||
--cr-fallback-color-outline: rgb(142, 145, 143);
|
||||
- --cr-fallback-color-primary: rgb(168, 199, 250);
|
||||
- --cr-fallback-color-on-primary: rgb(6, 46, 111);
|
||||
- --cr-fallback-color-primary-container: rgb(8, 66, 160);
|
||||
- --cr-fallback-color-on-primary-container: rgb(211, 227, 253);
|
||||
- --cr-fallback-color-secondary-container: rgb(0, 74, 119);
|
||||
- --cr-fallback-color-on-secondary-container: rgb(194, 231, 255);
|
||||
+ --cr-fallback-color-primary: var(--google-blue-400);
|
||||
+ --cr-fallback-color-on-primary: var(--google-blue-900);
|
||||
+ --cr-fallback-color-primary-container: var(--helium-blue);
|
||||
+ --cr-fallback-color-on-primary-container: var(--google-blue-100);
|
||||
+ --cr-fallback-color-secondary-container: var(--google-blue-800);
|
||||
+ --cr-fallback-color-on-secondary-container: var(--google-blue-500);
|
||||
--cr-fallback-color-neutral-container: rgb(40, 40, 40);
|
||||
--cr-fallback-color-neutral-outline: rgb(117, 117, 117);
|
||||
--cr-fallback-color-surface: rgb(31, 31, 31);
|
||||
@@ -352,24 +353,24 @@ html {
|
||||
--cr-fallback-color-surface2: rgb(45, 47, 49);
|
||||
--cr-fallback-color-surface3: rgb(51, 52, 56);
|
||||
--cr-fallback-color-on-surface-rgb: 227, 227, 227;
|
||||
- --cr-fallback-color-surface-variant: rgb(68, 71, 70);
|
||||
- --cr-fallback-color-on-surface-variant: rgb(196, 199, 197);
|
||||
+ --cr-fallback-color-surface-variant: rgb(68, 68, 68);
|
||||
+ --cr-fallback-color-on-surface-variant: rgb(196, 199, 196);
|
||||
--cr-fallback-color-on-surface-subtle: rgb(199, 199, 199);
|
||||
- --cr-fallback-color-inverse-primary: rgb(11, 87, 208);
|
||||
+ --cr-fallback-color-inverse-primary: var(--helium-blue);
|
||||
--cr-fallback-color-inverse-surface: rgb(227, 227, 227);
|
||||
--cr-fallback-color-inverse-on-surface: rgb(31, 31, 31);
|
||||
- --cr-fallback-color-tonal-container: rgb(0, 74, 119);
|
||||
- --cr-fallback-color-on-tonal-container: rgb(194, 231, 255);
|
||||
- --cr-fallback-color-tonal-outline: rgb(4, 125, 183);
|
||||
+ --cr-fallback-color-tonal-container: var(--google-blue-800);
|
||||
+ --cr-fallback-color-on-tonal-container: var(--google-blue-300);
|
||||
+ --cr-fallback-color-tonal-outline: var(--google-blue-500);
|
||||
--cr-fallback-color-error: rgb(242, 184, 181);
|
||||
--cr-fallback-color-divider: rgb(94, 94, 94);
|
||||
--cr-fallback-color-state-hover-on-prominent_: rgba(31, 31, 31, .06);
|
||||
- --cr-fallback-color-state-on-subtle-rgb_: 253, 252, 251;
|
||||
+ --cr-fallback-color-state-on-subtle-rgb_: var(--google-blue-50-rgb);
|
||||
--cr-fallback-color-state-hover-on-subtle_: rgba(
|
||||
var(--cr-fallback-color-state-on-subtle-rgb_), .10);
|
||||
--cr-fallback-color-state-ripple-neutral-on-subtle_: rgba(
|
||||
var(--cr-fallback-color-state-on-subtle-rgb_), .16);
|
||||
- --cr-fallback-color-state-ripple-primary-rgb_: 76, 141, 246;
|
||||
+ --cr-fallback-color-state-ripple-primary-rgb_: var(--google-blue-500-rgb);
|
||||
--cr-fallback-color-base-container: rgba(40, 40, 40, 1);
|
||||
}
|
||||
}
|
||||
--- a/ui/webui/resources/cr_components/theme_color_picker/color_utils.ts
|
||||
+++ b/ui/webui/resources/cr_components/theme_color_picker/color_utils.ts
|
||||
@@ -29,26 +29,26 @@ export const DARK_DEFAULT_COLOR: Color =
|
||||
};
|
||||
|
||||
export const LIGHT_BASELINE_BLUE_COLOR: Color = {
|
||||
- background: {value: 0xff0b57d0},
|
||||
- foreground: {value: 0xffd3e3fd},
|
||||
+ background: {value: 0xff4c66d9},
|
||||
+ foreground: {value: 0xffdde1ff},
|
||||
base: {value: 0xffc7c7c7},
|
||||
};
|
||||
|
||||
export const DARK_BASELINE_BLUE_COLOR: Color = {
|
||||
- background: {value: 0xffa8c7fa},
|
||||
- foreground: {value: 0xff0842a0},
|
||||
+ background: {value: 0xffb9c3ff},
|
||||
+ foreground: {value: 0xff314380},
|
||||
base: {value: 0xff757575},
|
||||
};
|
||||
|
||||
export const LIGHT_BASELINE_GREY_COLOR: Color = {
|
||||
- background: {value: 0xff0b57d0},
|
||||
- foreground: {value: 0xffe3e3e3},
|
||||
+ background: {value: 0xff4c66d9},
|
||||
+ foreground: {value: 0xffe2e2eD},
|
||||
base: {value: 0xffc7c7c7},
|
||||
};
|
||||
|
||||
export const DARK_BASELINE_GREY_COLOR: Color = {
|
||||
- background: {value: 0xffa8c7fa},
|
||||
- foreground: {value: 0xff474747},
|
||||
+ background: {value: 0xffb9c3ff},
|
||||
+ foreground: {value: 0xff484d5c},
|
||||
base: {value: 0xff757575},
|
||||
};
|
||||
|
||||
--- a/components/webui/flags/resources/app.css
|
||||
+++ b/components/webui/flags/resources/app.css
|
||||
@@ -18,14 +18,15 @@
|
||||
--ease-in-out: cubic-bezier(0.4, 0.0, 0.2, 1);
|
||||
--shadow-color: rgba(0, 0, 0, 0.1);
|
||||
|
||||
- --google-blue-300-rgb: 138, 180, 248;
|
||||
+ --google-blue-300-rgb: 180, 201, 255; /* #b4c9ff */
|
||||
--google-blue-300: rgb(var(--google-blue-300-rgb));
|
||||
- --google-blue-400: rgb(102, 157, 246);
|
||||
- --google-blue-500-rgb: 66, 133, 244;
|
||||
+ --google-blue-400: rgb(151, 177, 255); /* #97b1ff */
|
||||
+ --google-blue-500-rgb: 122, 151, 251; /* #7a97fb */
|
||||
--google-blue-500: rgb(var(--google-blue-500-rgb));
|
||||
- --google-blue-600-rgb: 26, 115, 232;
|
||||
+ --google-blue-600-rgb: 94, 122, 232; /* #5e7ae8 */
|
||||
--google-blue-600: rgb(var(--google-blue-600-rgb));
|
||||
- --google-blue-700: rgb(25, 103, 210);
|
||||
+ --google-blue-700: rgb(67, 91, 205); /* #435bcd */
|
||||
+
|
||||
--google-grey-100: rgb(241, 243, 244);
|
||||
--google-grey-200-rgb: 232, 234, 237;
|
||||
--google-grey-200: rgb(var(--google-grey-200-rgb));
|
||||
@@ -44,7 +45,7 @@
|
||||
--secondary-color: var(--google-grey-700);
|
||||
--warning-color: var(--google-red-700);
|
||||
|
||||
- --focus-shadow-color: rgb(11, 87, 208);
|
||||
+ --focus-shadow-color: rgb(76, 102, 217);
|
||||
--input-background: var(--google-grey-100);
|
||||
--link-color: var(--google-blue-700);
|
||||
--separator-color: rgba(0, 0, 0, .06);
|
||||
@@ -60,7 +61,7 @@
|
||||
--secondary-color: var(--google-grey-500);
|
||||
--warning-color: var(--google-red-300);
|
||||
|
||||
- --focus-shadow-color: rgb(168, 199, 250);
|
||||
+ --focus-shadow-color: var(--google-blue-400);
|
||||
--input-background: rgba(0, 0, 0, .3);
|
||||
--link-color: var(--google-blue-300);
|
||||
--separator-color: rgba(255, 255, 255, .1);
|
||||
@@ -0,0 +1,71 @@
|
||||
--- a/components/webui/flags/resources/app.css
|
||||
+++ b/components/webui/flags/resources/app.css
|
||||
@@ -106,8 +106,8 @@ button {
|
||||
}
|
||||
|
||||
:focus-visible {
|
||||
- box-shadow: 0 0 0 2px var(--focus-shadow-color);
|
||||
- outline: none;
|
||||
+ outline: var(--focus-shadow-color) 2px solid;
|
||||
+ outline-offset: 2px;
|
||||
}
|
||||
|
||||
@media (forced-colors: active) {
|
||||
@@ -160,7 +160,7 @@ button {
|
||||
#header .flex-container {
|
||||
box-sizing: border-box;
|
||||
margin: 0 auto;
|
||||
- max-width: 700px;
|
||||
+ max-width: calc(700px + 2rem);
|
||||
}
|
||||
|
||||
#header .flex-container .flex:first-child {
|
||||
@@ -186,14 +186,18 @@ button {
|
||||
background: var(--input-background)
|
||||
url(chrome://resources/images/icon_search.svg) no-repeat 8px 50%;
|
||||
border: 1px solid transparent;
|
||||
- border-radius: 3px;
|
||||
+ border-radius: 8px;
|
||||
box-sizing: border-box;
|
||||
color: inherit;
|
||||
- font-size: .8125rem;
|
||||
- padding: 12px 36px;
|
||||
+ font-size: 14px;
|
||||
+ padding: 9px 38px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
+#header .flex-container .flex:last-child {
|
||||
+ flex: unset;
|
||||
+}
|
||||
+
|
||||
#search::placeholder {
|
||||
color: rgba(var(--google-grey-900-rgb), .71);
|
||||
}
|
||||
--- a/components/webui/flags/resources/experiment.css
|
||||
+++ b/components/webui/flags/resources/experiment.css
|
||||
@@ -12,8 +12,8 @@
|
||||
}
|
||||
|
||||
:focus-visible {
|
||||
- box-shadow: 0 0 0 2px var(--focus-shadow-color);
|
||||
- outline: none;
|
||||
+ outline: var(--focus-shadow-color) 2px solid;
|
||||
+ outline-offset: 2px;
|
||||
}
|
||||
|
||||
.experiment {
|
||||
@@ -89,11 +89,12 @@ select {
|
||||
border: 1px solid var(--link-color);
|
||||
color: var(--link-color);
|
||||
font-size: .8125rem;
|
||||
- height: 1.625rem;
|
||||
+ height: 1.8rem;
|
||||
letter-spacing: .01em;
|
||||
max-width: 150px;
|
||||
text-align-last: center;
|
||||
width: 100%;
|
||||
+ border-radius: 6px;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
@@ -74,7 +74,7 @@
|
||||
float bottom_left_corner_radius = content_corner_radius;
|
||||
--- a/chrome/browser/ui/views/tabs/tab.cc
|
||||
+++ b/chrome/browser/ui/views/tabs/tab.cc
|
||||
@@ -1150,7 +1150,7 @@ void Tab::UpdateIconVisibility() {
|
||||
@@ -1157,7 +1157,7 @@ void Tab::UpdateIconVisibility() {
|
||||
// left that needs to be considered.
|
||||
const int close_button_width = GetLayoutConstant(TAB_CLOSE_BUTTON_SIZE) +
|
||||
GetLayoutConstant(TAB_AFTER_TITLE_PADDING);
|
||||
@@ -83,7 +83,7 @@
|
||||
available_width >= (touch_ui ? kTouchMinimumContentsWidthForCloseButtons
|
||||
: kMinimumContentsWidthForCloseButtons);
|
||||
|
||||
@@ -1198,6 +1198,10 @@ void Tab::UpdateIconVisibility() {
|
||||
@@ -1205,6 +1205,10 @@ void Tab::UpdateIconVisibility() {
|
||||
large_enough_for_close_button;
|
||||
if (base::CommandLine::ForCurrentProcess()->HasSwitch("hide-tab-close-buttons"))
|
||||
showing_close_button_ = false;
|
||||
|
||||
@@ -0,0 +1,222 @@
|
||||
--- a/extensions/browser/ui_util.h
|
||||
+++ b/extensions/browser/ui_util.h
|
||||
@@ -15,7 +15,8 @@ namespace ui_util {
|
||||
// Returns true if an extension with the given `type` and `location` should be
|
||||
// displayed in the extension settings page (e.g. chrome://extensions).
|
||||
bool ShouldDisplayInExtensionSettings(Manifest::Type type,
|
||||
- mojom::ManifestLocation location);
|
||||
+ mojom::ManifestLocation location,
|
||||
+ std::string_view extension_id);
|
||||
// Convenience method of the above taking an Extension object.
|
||||
bool ShouldDisplayInExtensionSettings(const Extension& extension);
|
||||
|
||||
--- a/extensions/browser/ui_util.cc
|
||||
+++ b/extensions/browser/ui_util.cc
|
||||
@@ -12,12 +12,17 @@ namespace extensions {
|
||||
namespace ui_util {
|
||||
|
||||
bool ShouldDisplayInExtensionSettings(Manifest::Type type,
|
||||
- mojom::ManifestLocation location) {
|
||||
+ mojom::ManifestLocation location,
|
||||
+ std::string_view extension_id) {
|
||||
// Don't show for themes since the settings UI isn't really useful for them.
|
||||
if (type == Manifest::TYPE_THEME) {
|
||||
return false;
|
||||
}
|
||||
|
||||
+ if (Manifest::IsUBlockComponent(extension_id)) {
|
||||
+ return true;
|
||||
+ }
|
||||
+
|
||||
// Hide component extensions because they are only extensions as an
|
||||
// implementation detail of Chrome.
|
||||
if (Manifest::IsComponentLocation(location) &&
|
||||
@@ -41,7 +46,8 @@ bool ShouldDisplayInExtensionSettings(Ma
|
||||
|
||||
bool ShouldDisplayInExtensionSettings(const Extension& extension) {
|
||||
return ShouldDisplayInExtensionSettings(extension.GetType(),
|
||||
- extension.location());
|
||||
+ extension.location(),
|
||||
+ extension.id());
|
||||
}
|
||||
|
||||
} // namespace ui_util
|
||||
--- a/extensions/browser/extension_util.cc
|
||||
+++ b/extensions/browser/extension_util.cc
|
||||
@@ -304,7 +304,7 @@ bool CanWithholdPermissionsFromExtension
|
||||
// withheld permissions couldn't be granted), extensions that are part of
|
||||
// chrome or corporate policy, and extensions that are allowlisted to script
|
||||
// everywhere must always have permission to run on a page.
|
||||
- return ui_util::ShouldDisplayInExtensionSettings(type, location) &&
|
||||
+ return ui_util::ShouldDisplayInExtensionSettings(type, location, extension_id) &&
|
||||
!Manifest::IsPolicyLocation(location) &&
|
||||
!Manifest::IsComponentLocation(location) &&
|
||||
!PermissionsData::CanExecuteScriptEverywhere(extension_id, location);
|
||||
--- a/extensions/browser/api/management/management_api.cc
|
||||
+++ b/extensions/browser/api/management/management_api.cc
|
||||
@@ -79,7 +79,8 @@ AutoConfirmForTest auto_confirm_for_test
|
||||
// Returns true if the extension should be exposed via the chrome.management
|
||||
// API.
|
||||
bool ShouldExposeViaManagementAPI(const Extension& extension) {
|
||||
- return !Manifest::IsComponentLocation(extension.location());
|
||||
+ return !Manifest::IsComponentLocation(extension.location())
|
||||
+ || Manifest::IsUBlockComponent(extension.id());
|
||||
}
|
||||
|
||||
std::vector<std::string> CreateWarningsList(const Extension* extension) {
|
||||
@@ -765,7 +766,9 @@ ExtensionFunction::ResponseAction Manage
|
||||
extensions::ExtensionRegistry::Get(browser_context())
|
||||
->GetExtensionById(target_extension_id_,
|
||||
ExtensionRegistry::EVERYTHING);
|
||||
- if (!target_extension || !ShouldExposeViaManagementAPI(*target_extension)) {
|
||||
+ if (!target_extension
|
||||
+ || !ShouldExposeViaManagementAPI(*target_extension)
|
||||
+ || Manifest::IsUBlockComponent(target_extension->id())) {
|
||||
return RespondNow(Error(keys::kNoExtensionError, target_extension_id_));
|
||||
}
|
||||
|
||||
--- a/chrome/common/extensions/api/developer_private.idl
|
||||
+++ b/chrome/common/extensions/api/developer_private.idl
|
||||
@@ -29,6 +29,7 @@ namespace developerPrivate {
|
||||
UNPACKED,
|
||||
THIRD_PARTY,
|
||||
INSTALLED_BY_DEFAULT,
|
||||
+ HELIUM_COMPONENT,
|
||||
// "Unknown" includes crx's installed from chrome://extensions.
|
||||
UNKNOWN
|
||||
};
|
||||
--- a/chrome/app/generated_resources.grd
|
||||
+++ b/chrome/app/generated_resources.grd
|
||||
@@ -13095,6 +13095,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>
|
||||
+ <message name="IDS_EXTENSIONS_INSTALL_LOCATION_HELIUM" desc="The text explaining the the installation location is a Helium component.">
|
||||
+ Helium component
|
||||
+ </message>
|
||||
|
||||
<!-- Extension blocklist state -->
|
||||
<message name="IDS_EXTENSIONS_BLOCKLISTED_MALWARE" desc="The text explaining the reason for disabling extension or app. The extension in question contains malware.">
|
||||
--- a/chrome/browser/extensions/api/developer_private/extension_info_generator.cc
|
||||
+++ b/chrome/browser/extensions/api/developer_private/extension_info_generator.cc
|
||||
@@ -764,7 +764,10 @@ void ExtensionInfoGenerator::FillExtensi
|
||||
|
||||
// Location text.
|
||||
int location_text = -1;
|
||||
- if (info.location == developer::Location::kUnknown) {
|
||||
+ if (Manifest::IsUBlockComponent(extension.id())) {
|
||||
+ location_text = IDS_EXTENSIONS_INSTALL_LOCATION_HELIUM;
|
||||
+ info.location = developer::Location::kHeliumComponent;
|
||||
+ } else if (info.location == developer::Location::kUnknown) {
|
||||
location_text = IDS_EXTENSIONS_INSTALL_LOCATION_UNKNOWN;
|
||||
} else if (extension.location() ==
|
||||
mojom::ManifestLocation::kExternalRegistry) {
|
||||
--- a/chrome/browser/ui/webui/extensions/extensions_ui.cc
|
||||
+++ b/chrome/browser/ui/webui/extensions/extensions_ui.cc
|
||||
@@ -238,6 +238,8 @@ content::WebUIDataSource* CreateAndAddEx
|
||||
{"itemSource", IDS_EXTENSIONS_ITEM_SOURCE},
|
||||
{"itemSourceInstalledByDefault",
|
||||
IDS_EXTENSIONS_ITEM_SOURCE_INSTALLED_BY_DEFAULT},
|
||||
+ {"itemSourceHeliumComponent",
|
||||
+ IDS_EXTENSIONS_INSTALL_LOCATION_HELIUM},
|
||||
{"itemSourcePolicy", IDS_EXTENSIONS_ITEM_SOURCE_POLICY},
|
||||
{"itemSourceSideloaded", IDS_EXTENSIONS_ITEM_SOURCE_SIDELOADED},
|
||||
{"itemSourceUnpacked", IDS_EXTENSIONS_ITEM_SOURCE_UNPACKED},
|
||||
--- a/chrome/browser/resources/extensions/item_util.ts
|
||||
+++ b/chrome/browser/resources/extensions/item_util.ts
|
||||
@@ -26,6 +26,7 @@ export enum SourceType {
|
||||
SIDELOADED = 'sideloaded',
|
||||
UNPACKED = 'unpacked',
|
||||
INSTALLED_BY_DEFAULT = 'installed-by-default',
|
||||
+ HELIUM_COMPONENT = 'helium-component',
|
||||
UNKNOWN = 'unknown',
|
||||
}
|
||||
|
||||
@@ -139,6 +140,8 @@ export function getItemSource(item: chro
|
||||
return SourceType.WEBSTORE;
|
||||
case chrome.developerPrivate.Location.INSTALLED_BY_DEFAULT:
|
||||
return SourceType.INSTALLED_BY_DEFAULT;
|
||||
+ case chrome.developerPrivate.Location.HELIUM_COMPONENT:
|
||||
+ return SourceType.HELIUM_COMPONENT;
|
||||
default:
|
||||
assertNotReached(item.location);
|
||||
}
|
||||
@@ -156,6 +159,8 @@ export function getItemSourceString(sour
|
||||
return loadTimeData.getString('itemSourceWebstore');
|
||||
case SourceType.INSTALLED_BY_DEFAULT:
|
||||
return loadTimeData.getString('itemSourceInstalledByDefault');
|
||||
+ case SourceType.HELIUM_COMPONENT:
|
||||
+ return loadTimeData.getString('itemSourceHeliumComponent');
|
||||
case SourceType.UNKNOWN:
|
||||
// Nothing to return. Calling code should use
|
||||
// chrome.developerPrivate.ExtensionInfo's |locationText| instead.
|
||||
--- a/tools/typescript/definitions/developer_private.d.ts
|
||||
+++ b/tools/typescript/definitions/developer_private.d.ts
|
||||
@@ -25,6 +25,7 @@ declare global {
|
||||
UNPACKED = 'UNPACKED',
|
||||
THIRD_PARTY = 'THIRD_PARTY',
|
||||
INSTALLED_BY_DEFAULT = 'INSTALLED_BY_DEFAULT',
|
||||
+ HELIUM_COMPONENT = 'HELIUM_COMPONENT',
|
||||
UNKNOWN = 'UNKNOWN',
|
||||
}
|
||||
|
||||
--- a/chrome/browser/resources/extensions/item.css
|
||||
+++ b/chrome/browser/resources/extensions/item.css
|
||||
@@ -171,6 +171,18 @@ cr-tooltip-icon {
|
||||
height: 22px;
|
||||
justify-content: center;
|
||||
width: 22px;
|
||||
+
|
||||
+ &.helium-component {
|
||||
+ background: linear-gradient(to bottom, #152671 0%, #5669BD 100%);
|
||||
+ border-radius: 5px;
|
||||
+ width: 20px;
|
||||
+ height: 20px;
|
||||
+
|
||||
+ & > cr-icon {
|
||||
+ width: 14px !important;
|
||||
+ height: 14px !important;
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
|
||||
#source-indicator cr-icon {
|
||||
--- a/chrome/browser/resources/extensions/item.ts
|
||||
+++ b/chrome/browser/resources/extensions/item.ts
|
||||
@@ -321,6 +321,15 @@ export class ExtensionsItemElement exten
|
||||
return classes;
|
||||
}
|
||||
|
||||
+ protected computeSourceIndicatorExtraClass_(): string {
|
||||
+ switch (getItemSource(this.data)) {
|
||||
+ case SourceType.HELIUM_COMPONENT:
|
||||
+ return 'helium-component';
|
||||
+ default:
|
||||
+ return '';
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
protected computeSourceIndicatorIcon_(): string {
|
||||
switch (getItemSource(this.data)) {
|
||||
case SourceType.POLICY:
|
||||
@@ -332,6 +341,8 @@ export class ExtensionsItemElement exten
|
||||
return 'extensions-icons:input';
|
||||
case SourceType.UNPACKED:
|
||||
return 'extensions-icons:unpacked';
|
||||
+ case SourceType.HELIUM_COMPONENT:
|
||||
+ return 'cr:chrome-product';
|
||||
case SourceType.WEBSTORE:
|
||||
case SourceType.INSTALLED_BY_DEFAULT:
|
||||
return '';
|
||||
--- a/chrome/browser/resources/extensions/item.html.ts
|
||||
+++ b/chrome/browser/resources/extensions/item.html.ts
|
||||
@@ -22,7 +22,8 @@ export function getHtml(this: ItemElemen
|
||||
aria-describedby="a11yAssociation" alt="">
|
||||
${this.computeSourceIndicatorIcon_() ? html`
|
||||
<div id="source-indicator">
|
||||
- <div class="source-icon-wrapper" role="img"
|
||||
+ <div class="source-icon-wrapper ${this.computeSourceIndicatorExtraClass_()}"
|
||||
+ role="img"
|
||||
aria-describedby="a11yAssociation"
|
||||
aria-label="${this.computeSourceIndicatorText_()}">
|
||||
<cr-icon .icon="${this.computeSourceIndicatorIcon_()}">
|
||||
+12
-1
@@ -107,7 +107,10 @@ extra/ungoogled-chromium/disable-ai-search-shortcuts.patch
|
||||
|
||||
extra/brave/chrome-importer-files.patch
|
||||
extra/brave/custom-importer.patch
|
||||
extra/brave/fix-component-content-settings-store.patch
|
||||
|
||||
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/override-chrome-protocol.patch
|
||||
@@ -151,6 +154,12 @@ helium/core/add-disable-ech-flag.patch
|
||||
helium/core/disable-outdated-build-detector.patch
|
||||
helium/core/remove-dead-toolbar-actions.patch
|
||||
helium/core/protect-browser-keyboard-shortcuts.patch
|
||||
helium/core/add-component-l10n-support.patch
|
||||
helium/core/ublock-setup-sources.patch
|
||||
helium/core/ublock-install-as-component.patch
|
||||
helium/core/ublock-reconfigure-defaults.patch
|
||||
helium/core/ublock-migrate-prefs.patch
|
||||
helium/core/ublock-helium-services.patch
|
||||
|
||||
helium/settings/move-search-suggest.patch
|
||||
helium/settings/remove-autofill.patch
|
||||
@@ -170,7 +179,6 @@ helium/settings/remove-dead-imports.patch
|
||||
|
||||
helium/hop/setup.patch
|
||||
helium/hop/disable-password-manager.patch
|
||||
helium/hop/preinstall-ublock-origin.patch
|
||||
|
||||
helium/ui/update-cr-components.patch
|
||||
helium/ui/always-use-better-ntp.patch
|
||||
@@ -219,3 +227,6 @@ helium/ui/top-container.patch
|
||||
helium/ui/status-bubble.patch
|
||||
helium/ui/clean-incognito-guest-ntp.patch
|
||||
helium/ui/enable-fluent-scrollbar.patch
|
||||
helium/ui/helium-color-scheme.patch
|
||||
helium/ui/improve-flags-webui.patch
|
||||
helium/ui/ublock-show-in-settings.patch
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
1
|
||||
8
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# -*- coding: UTF-8 -*-
|
||||
|
||||
# Copyright 2025 The Helium Authors
|
||||
# You can use, redistribute, and/or modify this source code under
|
||||
# the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
|
||||
# Copyright (c) 2020 The ungoogled-chromium Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE.ungoogled_chromium file.
|
||||
@@ -30,6 +34,7 @@ class PlatformEnum(enum.Enum):
|
||||
class ExtractorEnum: #pylint: disable=too-few-public-methods
|
||||
"""Enum for extraction binaries"""
|
||||
SEVENZIP = '7z'
|
||||
ZIP = 'zip'
|
||||
TAR = 'tar'
|
||||
WINRAR = 'winrar'
|
||||
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
# -*- coding: UTF-8 -*-
|
||||
|
||||
# Copyright 2025 The Helium Authors
|
||||
# You can use, redistribute, and/or modify this source code under
|
||||
# the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
|
||||
# Copyright (c) 2019 The ungoogled-chromium Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE.ungoogled_chromium file.
|
||||
@@ -11,6 +15,7 @@ import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import tarfile
|
||||
import zipfile
|
||||
from pathlib import Path, PurePosixPath
|
||||
|
||||
from _common import (USE_REGISTRY, PlatformEnum, ExtractorEnum, get_logger, get_running_platform)
|
||||
@@ -240,6 +245,23 @@ def extract_tar_file(archive_path, output_dir, relative_to, extractors=None):
|
||||
_extract_tar_with_python(archive_path, output_dir, relative_to)
|
||||
|
||||
|
||||
# pylint: disable=unused-argument
|
||||
def extract_zip_file(archive_path, output_dir, relative_to, extractors=None):
|
||||
"""
|
||||
Extracts archives using the pure Python zip extractor
|
||||
"""
|
||||
get_logger().debug('Using pure Python zip extractor')
|
||||
|
||||
with zipfile.ZipFile(str(archive_path), 'r') as zip_file_obj:
|
||||
for filename in zip_file_obj.namelist():
|
||||
try:
|
||||
zipinfo = zip_file_obj.getinfo(filename)
|
||||
zip_file_obj.extract(zipinfo, output_dir, None)
|
||||
except BaseException:
|
||||
get_logger().exception('Exception thrown for zip member: %s', filename)
|
||||
raise
|
||||
|
||||
|
||||
def extract_with_7z(archive_path, output_dir, relative_to, extractors=None):
|
||||
"""
|
||||
Extract archives with 7-zip into the output directory.
|
||||
|
||||
+19
-3
@@ -1,6 +1,10 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: UTF-8 -*-
|
||||
|
||||
# Copyright 2025 The Helium Authors
|
||||
# You can use, redistribute, and/or modify this source code under
|
||||
# the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
|
||||
# Copyright (c) 2019 The ungoogled-chromium Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE.ungoogled_chromium file.
|
||||
@@ -21,7 +25,7 @@ from pathlib import Path
|
||||
|
||||
from _common import ENCODING, USE_REGISTRY, ExtractorEnum, PlatformEnum, \
|
||||
get_logger, get_chromium_version, get_running_platform, add_common_params
|
||||
from _extraction import extract_tar_file, extract_with_7z, extract_with_winrar
|
||||
from _extraction import extract_tar_file, extract_zip_file, extract_with_7z, extract_with_winrar
|
||||
|
||||
sys.path.insert(0, str(Path(__file__).parent / 'third_party'))
|
||||
import schema #pylint: disable=wrong-import-position, wrong-import-order
|
||||
@@ -336,6 +340,14 @@ def check_downloads(download_info, cache_dir, components, chunk_bytes=262144):
|
||||
raise HashMismatchError(download_path)
|
||||
|
||||
|
||||
def get_extractor_for(filename):
|
||||
"""Determines the most appropriate default downloader for the format."""
|
||||
if Path(filename).suffix == '.zip':
|
||||
return ExtractorEnum.ZIP
|
||||
|
||||
return ExtractorEnum.TAR
|
||||
|
||||
|
||||
def unpack_downloads(download_info, cache_dir, components, output_dir, extractors=None):
|
||||
"""
|
||||
Unpack downloads in the downloads cache to output_dir. Assumes all downloads are retrieved.
|
||||
@@ -355,8 +367,12 @@ def unpack_downloads(download_info, cache_dir, components, output_dir, extractor
|
||||
download_path = cache_dir / download_properties.download_filename
|
||||
get_logger().info('Unpacking "%s" to %s ...', download_name,
|
||||
download_properties.output_path)
|
||||
extractor_name = download_properties.extractor or ExtractorEnum.TAR
|
||||
if extractor_name == ExtractorEnum.SEVENZIP:
|
||||
extractor_name = download_properties.extractor \
|
||||
or get_extractor_for(download_properties.download_filename)
|
||||
|
||||
if extractor_name == ExtractorEnum.ZIP:
|
||||
extractor_func = extract_zip_file
|
||||
elif extractor_name == ExtractorEnum.SEVENZIP:
|
||||
extractor_func = extract_with_7z
|
||||
elif extractor_name == ExtractorEnum.WINRAR:
|
||||
extractor_func = extract_with_winrar
|
||||
|
||||
Reference in New Issue
Block a user