From 1332faef68d85693bd777b64a11950bf9cc93744 Mon Sep 17 00:00:00 2001 From: Carmelo Messina Date: Thu, 14 Nov 2024 15:06:26 +0100 Subject: [PATCH] [REBASE] Final patches for 131 --- .../Add-a-proxy-configuration-page.patch | 23 +-- .../Add-an-always-incognito-mode.patch | 16 +- .../Add-bookmark-import-export-actions.patch | 31 +--- build/patches/Add-cromite-flags-support.patch | 88 +++++++++- ...-to-disable-external-intent-requests.patch | 2 +- .../Add-menu-item-to-bookmark-all-tabs.patch | 32 +++- .../Add-option-to-force-tablet-UI.patch | 9 +- ...Ask-for-restart-on-connection-change.patch | 2 +- .../Bromite-subresource-adblocker.patch | 18 +- .../patches/Chrome-web-store-protection.patch | 22 ++- build/patches/Customize-selection-popup.patch | 4 +- .../Disable-Android-AppRestrictions.patch | 2 +- build/patches/Disable-Compose-feature.patch | 49 +++++- .../patches/Disable-all-predictors-code.patch | 7 +- .../Disable-conversion-measurement-api.patch | 10 +- ...ndroid-Dynamic-Performance-Framework.patch | 30 ++-- .../Enable-ImprovedBookmarks-by-default.patch | 22 +-- .../Enable-native-Android-autofill.patch | 5 +- ...le-search-engine-settings-desktop-ui.patch | 164 ++++++++++++++---- ...ivation-of-the-js-debugger-statement.patch | 2 +- .../Experimental-user-scripts-support.patch | 35 ++-- ...story-number-of-days-privacy-setting.patch | 15 +- .../patches/Keep-disabled-FetchLaterAPI.patch | 27 ++- .../Move-navigation-bar-to-bottom.patch | 4 +- .../Partition-Blink-memory-cache.patch | 15 +- .../patches/Partition-HSTS-cache-by-NAK.patch | 4 +- .../Remove-binary-blob-integrations.patch | 74 ++++++-- ...vert-flags-remove-num-raster-threads.patch | 8 +- ...script-content-setting-secondary-url.patch | 2 +- build/patches/Show-NTP-at-startup.patch | 2 +- ...formanceNavigationTiming-privacy-fix.patch | 2 +- ...ileSystemAccessPersistentPermissions.patch | 9 +- .../Use-browser-navigation-handler.patch | 15 +- .../Use-list-mode-for-tab-switcher.patch | 2 +- build/patches/bromite-build-utils.patch | 4 +- .../eyeo-beta-118.0.5993.48-android_api.patch | 6 +- .../eyeo-beta-118.0.5993.48-base.patch | 16 +- ...eta-118.0.5993.48-chrome_integration.patch | 31 ++-- ...ed-chromium-no-special-hosts-domains.patch | 15 +- 39 files changed, 585 insertions(+), 239 deletions(-) diff --git a/build/patches/Add-a-proxy-configuration-page.patch b/build/patches/Add-a-proxy-configuration-page.patch index fc8232d90..0675e3bc4 100644 --- a/build/patches/Add-a-proxy-configuration-page.patch +++ b/build/patches/Add-a-proxy-configuration-page.patch @@ -29,7 +29,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html chrome/browser/resources/proxy_config.html | 77 ++++ chrome/browser/resources/proxy_config.js | 278 +++++++++++++ chrome/browser/ui/BUILD.gn | 2 + - .../webui/chrome_web_ui_controller_factory.cc | 4 + + .../webui/chrome_web_ui_controller_factory.cc | 5 +- chrome/browser/ui/webui/proxy_config_ui.cc | 389 ++++++++++++++++++ chrome/browser/ui/webui/proxy_config_ui.h | 31 ++ chrome/common/webui_url_constants.cc | 2 + @@ -40,7 +40,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../proxy_config/proxy_policy_handler.cc | 2 +- net/proxy_resolution/proxy_config.cc | 51 ++- net/proxy_resolution/proxy_config.h | 3 + - 25 files changed, 974 insertions(+), 17 deletions(-) + 25 files changed, 974 insertions(+), 18 deletions(-) create mode 100644 chrome/browser/resources/proxy_config.css create mode 100644 chrome/browser/resources/proxy_config.html create mode 100644 chrome/browser/resources/proxy_config.js @@ -680,16 +680,17 @@ diff --git a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc b/chrom #include "chrome/browser/ui/webui/download_internals/download_internals_ui.h" #include "chrome/browser/ui/webui/flags/flags_ui.h" #include "chrome/browser/ui/webui/webui_util.h" -@@ -508,6 +509,9 @@ base::RefCountedMemory* ChromeWebUIControllerFactory::GetFaviconResourceBytes( - #endif // BUILDFLAG(ENABLE_EXTENSIONS) - #endif // !BUILDFLAG(IS_ANDROID) - -+ if (url.host_piece() == chrome::kChromeUIProxyConfigHost) +@@ -261,7 +262,9 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui, + history_clusters_internals::kChromeUIHistoryClustersInternalsHost) { + return &NewWebUI; + } +- ++ if (url.host_piece() == chrome::kChromeUIProxyConfigHost) { + return &NewWebUI; -+ - #if BUILDFLAG(IS_CHROMEOS_ASH) - if (page_url.host_piece() == chrome::kChromeUIOSSettingsHost) - return settings_utils::GetFaviconResourceBytes(scale_factor); ++ } + #if !BUILDFLAG(IS_ANDROID) + if (url.host_piece() == chrome::kChromeUINewTabHost) { + // The URL chrome://newtab/ can be either a virtual or a real URL, diff --git a/chrome/browser/ui/webui/proxy_config_ui.cc b/chrome/browser/ui/webui/proxy_config_ui.cc new file mode 100644 --- /dev/null diff --git a/build/patches/Add-an-always-incognito-mode.patch b/build/patches/Add-an-always-incognito-mode.patch index c0fe30aa1..47a7183d4 100644 --- a/build/patches/Add-an-always-incognito-mode.patch +++ b/build/patches/Add-an-always-incognito-mode.patch @@ -79,12 +79,12 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../browser/autocomplete_provider_client.cc | 4 + .../browser/autocomplete_provider_client.h | 1 + .../omnibox/browser/base_search_provider.cc | 2 +- - components/omnibox/browser/search_provider.cc | 4 +- + components/omnibox/browser/search_provider.cc | 7 +- .../add-an-always-incognito-mode.inc | 13 ++ .../add-an-always-incognito-mode.inc | 1 + .../add-an-always-incognito-mode.inc | 3 + .../add-an-always-incognito-mode.inc | 1 + - 65 files changed, 785 insertions(+), 112 deletions(-) + 65 files changed, 787 insertions(+), 113 deletions(-) create mode 100644 chrome/android/java/res/xml/incognito_preferences.xml create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/AlwaysIncognitoLinkInterceptor.java create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/IncognitoSettings.java @@ -1590,7 +1590,7 @@ diff --git a/chrome/browser/offline_pages/android/request_coordinator_factory.cc + return BrowserContextKeyedServiceFactory::GetBrowserContextToUse(context); + } + -+ return chrome::GetBrowserContextRedirectedInIncognito(context); ++ return GetBrowserContextRedirectedInIncognito(context); +} + + @@ -2168,6 +2168,16 @@ diff --git a/components/omnibox/browser/search_provider.cc b/components/omnibox/ ((default_url && !default_url->suggestions_url().empty() && !*query_is_private) || (keyword_url && !keyword_url->suggestions_url().empty())); +@@ -937,7 +939,8 @@ std::unique_ptr SearchProvider::CreateSuggestLoader( + // purpose of such a request is to signal the server to warm up; no info + // is required. + // Request for suggestions in OTR contexts is not allowed. +- DCHECK(!client()->IsOffTheRecord()); ++ if (!client()->IsAlwaysIncognitoEnabled()) ++ DCHECK(!client()->IsOffTheRecord()); + return client() + ->GetRemoteSuggestionsService(/*create_if_necessary=*/true) + ->StartSuggestionsRequest( diff --git a/cromite_flags/chrome/browser/about_flags_cc/add-an-always-incognito-mode.inc b/cromite_flags/chrome/browser/about_flags_cc/add-an-always-incognito-mode.inc new file mode 100644 --- /dev/null diff --git a/build/patches/Add-bookmark-import-export-actions.patch b/build/patches/Add-bookmark-import-export-actions.patch index 168559e75..6f9226233 100644 --- a/build/patches/Add-bookmark-import-export-actions.patch +++ b/build/patches/Add-bookmark-import-export-actions.patch @@ -26,9 +26,9 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../bookmarks/BookmarkToolbarViewBinder.java | 6 + .../native_page/NativePageFactory.java | 11 +- chrome/browser/BUILD.gn | 11 +- - .../bookmarks/android/bookmark_bridge.cc | 282 +++++++++++++++++ + .../bookmarks/android/bookmark_bridge.cc | 277 +++++++++++++++++ .../bookmarks/android/bookmark_bridge.h | 29 +- - .../browser/bookmarks/bookmark_html_writer.cc | 11 + + .../browser/bookmarks/bookmark_html_writer.cc | 3 + .../dialogs/DownloadLocationCustomView.java | 8 +- .../DownloadLocationDialogCoordinator.java | 10 +- .../flags/android/chrome_feature_list.cc | 1 + @@ -53,7 +53,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html ui/shell_dialogs/select_file_dialog_linux.cc | 4 + ui/shell_dialogs/select_file_dialog_linux.h | 2 + ui/shell_dialogs/select_file_dialog_win.cc | 5 + - 42 files changed, 913 insertions(+), 30 deletions(-) + 42 files changed, 900 insertions(+), 30 deletions(-) create mode 100644 cromite_flags/chrome/browser/about_flags_cc/add-bookmark-import-export-actions.inc create mode 100644 cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/add-bookmark-import-export-actions.inc create mode 100644 cromite_flags/chrome/browser/flags/android/chrome_feature_list_h/add-bookmark-import-export-actions.inc @@ -987,7 +987,7 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browse } void BookmarkBridge::Destroy(JNIEnv* env) { -@@ -767,6 +878,177 @@ jint BookmarkBridge::GetTotalBookmarkCount( +@@ -767,6 +878,172 @@ jint BookmarkBridge::GetTotalBookmarkCount( return count; } @@ -1078,12 +1078,7 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browse +} + +const std::string BookmarkBridge::FileSelectedImpl(const base::FilePath& path) { -+ base::File file; -+ if (path.IsContentUri()) { -+ file = base::OpenContentUri(path, base::File::FLAG_OPEN | base::File::FLAG_READ); -+ } else { -+ file.Initialize(path, base::File::FLAG_OPEN | base::File::FLAG_READ); -+ } ++ base::File file(path, base::File::FLAG_OPEN | base::File::FLAG_READ); + if (!file.IsValid()) { + select_file_dialog_->ShowToast("Cannot open bookmarks file for import"); + return ""; @@ -1266,22 +1261,6 @@ diff --git a/chrome/browser/bookmarks/bookmark_html_writer.cc b/chrome/browser/b #include "chrome/browser/bookmarks/bookmark_model_factory.h" #include "chrome/browser/favicon/favicon_service_factory.h" #include "chrome/browser/profiles/profile.h" -@@ -240,7 +243,15 @@ class Writer : public base::RefCountedThreadSafe { - // Opens the file, returning true on success. - bool OpenFile() { - int flags = base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE; -+#if BUILDFLAG(IS_ANDROID) -+ if (path_.IsContentUri()) { -+ file_ = std::make_unique(base::OpenContentUriForWrite(path_)); -+ } else { -+ file_ = std::make_unique(path_, flags); -+ } -+#else - file_ = std::make_unique(path_, flags); -+#endif - if (!file_->IsValid()) { - PLOG(ERROR) << "Could not create " << path_; - return false; diff --git a/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationCustomView.java b/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationCustomView.java --- a/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationCustomView.java +++ b/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationCustomView.java diff --git a/build/patches/Add-cromite-flags-support.patch b/build/patches/Add-cromite-flags-support.patch index f0b59ee1c..346213030 100644 --- a/build/patches/Add-cromite-flags-support.patch +++ b/build/patches/Add-cromite-flags-support.patch @@ -15,6 +15,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html --- base/BUILD.gn | 4 +- base/android/feature_map.cc | 5 + + .../base/cached_flags/ValuesReturned.java | 2 +- base/feature_list.cc | 76 ++++++++ base/feature_list.h | 72 +++++++- build/android/gyp/java_cpp_features.py | 17 ++ @@ -53,13 +54,15 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html components/flags_ui/resources/app.ts | 23 +++ components/flags_ui/resources/experiment.css | 7 +- .../flags_ui/resources/experiment.html.ts | 7 +- - components/flags_ui/resources/experiment.ts | 9 +- + components/flags_ui/resources/experiment.ts | 14 +- .../flags_ui/resources/flags_browser_proxy.ts | 5 + .../core/offline_page_feature.cc | 1 + .../offline_pages/core/offline_page_feature.h | 1 + .../browser/features/password_features.cc | 1 + components/permissions/features.cc | 1 + - .../version_ui/version_handler_helper.cc | 2 +- + ...nthetic_trials_active_group_id_provider.cc | 4 +- + ...ynthetic_trials_active_group_id_provider.h | 4 +- + .../version_ui/version_handler_helper.cc | 4 +- content/common/features.cc | 1 + content/public/common/content_features.cc | 1 + content/public/common/content_features.h | 1 + @@ -99,7 +102,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html third_party/blink/public/common/features.h | 1 + ui/base/ui_base_features.cc | 1 + ui/base/ui_base_features.h | 1 + - 86 files changed, 781 insertions(+), 22 deletions(-) + 89 files changed, 792 insertions(+), 28 deletions(-) create mode 100644 chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/cromite/include_all_directory.java create mode 100644 chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/cromite/java_template/CromiteCachedFlag.java.tmpl create mode 100644 chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Add-cromite-flags-support.grdp @@ -168,6 +171,18 @@ diff --git a/base/android/feature_map.cc b/base/android/feature_map.cc FeatureMap* feature_map = reinterpret_cast(jfeature_map); const base::Feature* feature = feature_map->FindFeatureExposedToJava(feature_name); +diff --git a/base/android/java/src/org/chromium/base/cached_flags/ValuesReturned.java b/base/android/java/src/org/chromium/base/cached_flags/ValuesReturned.java +--- a/base/android/java/src/org/chromium/base/cached_flags/ValuesReturned.java ++++ b/base/android/java/src/org/chromium/base/cached_flags/ValuesReturned.java +@@ -16,7 +16,7 @@ import java.util.Map; + /** Keeps track of values returned for cached flags and field trial parameters. */ + public abstract class ValuesReturned { + @GuardedBy("sBoolValues") +- private static final Map sBoolValues = new HashMap<>(); ++ public static final Map sBoolValues = new HashMap<>(); + + @GuardedBy("sStringValues") + private static final Map sStringValues = new HashMap<>(); diff --git a/base/feature_list.cc b/base/feature_list.cc --- a/base/feature_list.cc +++ b/base/feature_list.cc @@ -789,7 +804,7 @@ new file mode 100644 +import java.util.ArrayList; +import java.util.List; + -+import org.chromium.base.cached_flags.CachedFlag; ++import org.chromium.components.cached_flags.CachedFlag; + +{IMPORT_CLAUSE} + @@ -1352,7 +1367,19 @@ diff --git a/components/flags_ui/resources/experiment.html.ts b/components/flags diff --git a/components/flags_ui/resources/experiment.ts b/components/flags_ui/resources/experiment.ts --- a/components/flags_ui/resources/experiment.ts +++ b/components/flags_ui/resources/experiment.ts -@@ -127,12 +127,15 @@ export class ExperimentElement extends CrLitElement { +@@ -81,6 +81,11 @@ export class ExperimentElement extends CrLitElement { + enabled: false, + is_default: false, + supported_platforms: [], ++ is_default_value_on: false, ++ default_value: '', ++ is_cromite: false, ++ is_new: false, ++ permalink: true, + }; + + // Whether the controls to change the experiment state should be hidden. +@@ -127,12 +132,15 @@ export class ExperimentElement extends CrLitElement { } protected getExperimentTitle_(): string { @@ -1426,9 +1453,60 @@ diff --git a/components/permissions/features.cc b/components/permissions/feature } // namespace features namespace feature_params { +diff --git a/components/variations/synthetic_trials_active_group_id_provider.cc b/components/variations/synthetic_trials_active_group_id_provider.cc +--- a/components/variations/synthetic_trials_active_group_id_provider.cc ++++ b/components/variations/synthetic_trials_active_group_id_provider.cc +@@ -27,7 +27,7 @@ SyntheticTrialsActiveGroupIdProvider::GetActiveGroupIds() { + return group_ids_; + } + +-#if !defined(NDEBUG) ++#if true + std::vector + SyntheticTrialsActiveGroupIdProvider::GetGroups() { + base::AutoLock scoped_lock(lock_); +@@ -53,7 +53,7 @@ void SyntheticTrialsActiveGroupIdProvider::OnSyntheticTrialsChanged( + for (const auto& group : groups) { + group_ids_.push_back(group.id()); + } +-#if !defined(NDEBUG) ++#if true + groups_ = groups; + #endif // !defined(NDEBUG) + } +diff --git a/components/variations/synthetic_trials_active_group_id_provider.h b/components/variations/synthetic_trials_active_group_id_provider.h +--- a/components/variations/synthetic_trials_active_group_id_provider.h ++++ b/components/variations/synthetic_trials_active_group_id_provider.h +@@ -36,7 +36,7 @@ class COMPONENT_EXPORT(VARIATIONS) SyntheticTrialsActiveGroupIdProvider + // Returns currently active synthetic trial group IDs. + std::vector GetActiveGroupIds(); + +-#if !defined(NDEBUG) ++#if true + // In debug mode, not only the group IDs are tracked but also the full group + // info, to display the names unhashed in chrome://version. + std::vector GetGroups(); +@@ -60,7 +60,7 @@ class COMPONENT_EXPORT(VARIATIONS) SyntheticTrialsActiveGroupIdProvider + + base::Lock lock_; + std::vector group_ids_; // GUARDED_BY(lock_); +-#if !defined(NDEBUG) ++#if true + // In debug builds, keep the full group information to be able to display it + // in chrome://version. + std::vector groups_; // GUARDED_BY(lock_); diff --git a/components/version_ui/version_handler_helper.cc b/components/version_ui/version_handler_helper.cc --- a/components/version_ui/version_handler_helper.cc +++ b/components/version_ui/version_handler_helper.cc +@@ -20,7 +20,7 @@ + namespace version_ui { + namespace { + +-#if !defined(NDEBUG) ++#if true + std::string GetActiveGroupNameAsString( + const base::FieldTrial::ActiveGroup& group) { + static const unsigned char kNonBreakingHyphenUTF8[] = {0xE2, 0x80, 0x91, @@ -56,7 +56,7 @@ base::Value::List GetVariationsList() { base::FieldTrialListIncludingLowAnonymity::GetActiveFieldTrialGroups( &active_groups); diff --git a/build/patches/Add-flag-to-disable-external-intent-requests.patch b/build/patches/Add-flag-to-disable-external-intent-requests.patch index 8350f7667..defd6307e 100644 --- a/build/patches/Add-flag-to-disable-external-intent-requests.patch +++ b/build/patches/Add-flag-to-disable-external-intent-requests.patch @@ -90,7 +90,7 @@ new file mode 100644 + +package org.chromium.chrome.browser.flags.cromite; + -+import org.chromium.base.cached_flags.CachedFlag; ++import org.chromium.components.cached_flags.CachedFlag; +import org.chromium.chrome.browser.flags.ChromeFeatureMap; + +public class sAllowExternalIntentRequests { diff --git a/build/patches/Add-menu-item-to-bookmark-all-tabs.patch b/build/patches/Add-menu-item-to-bookmark-all-tabs.patch index 19ce540d7..427ab0570 100644 --- a/build/patches/Add-menu-item-to-bookmark-all-tabs.patch +++ b/build/patches/Add-menu-item-to-bookmark-all-tabs.patch @@ -10,8 +10,10 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../bookmarks/android/bookmark_bridge.cc | 44 +++++++++++- .../bookmarks/android/bookmark_bridge.h | 8 +++ .../browser/bookmarks/bookmark_html_writer.cc | 11 ++- + .../bookmark_merged_surface_service.cc | 2 + .../dialogs/DownloadLocationCustomView.java | 4 +- .../strings/android_chrome_strings.grd | 3 + + .../views/bookmarks/bookmark_menu_delegate.cc | 2 + components/bookmark_bar_strings.grdp | 6 ++ .../bookmarks/browser/bookmark_codec.cc | 20 +++++- components/bookmarks/browser/bookmark_codec.h | 7 +- @@ -26,7 +28,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html components/bookmarks/browser/bookmark_uuids.h | 1 + components/bookmarks/browser/model_loader.cc | 8 ++- .../bookmark_specifics_conversions.cc | 1 + - 22 files changed, 241 insertions(+), 15 deletions(-) + 24 files changed, 245 insertions(+), 15 deletions(-) diff --git a/chrome/android/java/res/menu/main_menu.xml b/chrome/android/java/res/menu/main_menu.xml --- a/chrome/android/java/res/menu/main_menu.xml @@ -281,7 +283,7 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browse const BookmarkNode* reading_list_node = local_or_syncable_reading_list_manager_->GetRoot(); if (IsPermanentFolderVisible(ignore_visibility, reading_list_node)) { -@@ -1266,6 +1297,17 @@ void BookmarkBridge::GetBookmarksOfType( +@@ -1261,6 +1292,17 @@ void BookmarkBridge::GetBookmarksOfType( AddBookmarkNodesToBookmarkIdList(env, j_list, results); } @@ -358,7 +360,7 @@ diff --git a/chrome/browser/bookmarks/bookmark_html_writer.cc b/chrome/browser/b NotifyOnFinish(BookmarksExportObserver::Result::kCouldNotWriteNodes); return; } -@@ -472,6 +477,8 @@ void BookmarkFaviconFetcher::ExportBookmarks() { +@@ -464,6 +469,8 @@ void BookmarkFaviconFetcher::ExportBookmarks() { BookmarkModelFactory::GetForBrowserContext(profile_)->other_node()); ExtractUrls( BookmarkModelFactory::GetForBrowserContext(profile_)->mobile_node()); @@ -367,6 +369,18 @@ diff --git a/chrome/browser/bookmarks/bookmark_html_writer.cc b/chrome/browser/b if (!bookmark_urls_.empty()) FetchNextFavicon(); else +diff --git a/chrome/browser/bookmarks/bookmark_merged_surface_service.cc b/chrome/browser/bookmarks/bookmark_merged_surface_service.cc +--- a/chrome/browser/bookmarks/bookmark_merged_surface_service.cc ++++ b/chrome/browser/bookmarks/bookmark_merged_surface_service.cc +@@ -42,6 +42,8 @@ std::optional GetIfPermanentFolderType( + + case BookmarkNode::Type::URL: + NOTREACHED(); ++ case BookmarkNode::Type::TABS_COLLECTION: ++ NOTREACHED(); + } + NOTREACHED(); + } diff --git a/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationCustomView.java b/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationCustomView.java --- a/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationCustomView.java +++ b/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationCustomView.java @@ -401,6 +415,18 @@ diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chro Get image descriptions +diff --git a/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc b/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc +--- a/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc ++++ b/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc +@@ -157,6 +157,8 @@ BookmarkParentFolder GetBookmarkParentFolderForNode( + return BookmarkParentFolder::OtherFolder(); + case bookmarks::BookmarkNode::MOBILE: + return BookmarkParentFolder::MobileFolder(); ++ case bookmarks::BookmarkNode::TABS_COLLECTION: ++ NOTREACHED(); + } + NOTREACHED(); + } diff --git a/components/bookmark_bar_strings.grdp b/components/bookmark_bar_strings.grdp --- a/components/bookmark_bar_strings.grdp +++ b/components/bookmark_bar_strings.grdp diff --git a/build/patches/Add-option-to-force-tablet-UI.patch b/build/patches/Add-option-to-force-tablet-UI.patch index 0f61497c0..c15844f25 100644 --- a/build/patches/Add-option-to-force-tablet-UI.patch +++ b/build/patches/Add-option-to-force-tablet-UI.patch @@ -17,7 +17,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html .../strip/StripLayoutHelperManager.java | 5 +++- .../init/ChromeBrowserInitializer.java | 2 ++ .../tabbed_mode/TabbedRootUiCoordinator.java | 4 +++- - .../chrome/browser/ui/RootUiCoordinator.java | 5 +++- + .../chrome/browser/ui/RootUiCoordinator.java | 6 ++++- chrome/browser/preferences/BUILD.gn | 1 + .../preferences/ChromePreferenceKeys.java | 1 + .../preferences/ChromeSharedPreferences.java | 12 ++++++++++ @@ -37,7 +37,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html .../res/xml/accessibility_preferences.xml | 5 ++++ .../AccessibilitySettingsDelegate.java | 11 +++++++++ .../chromium/ui/base/DeviceFormFactor.java | 14 +++++++++++ - 33 files changed, 175 insertions(+), 27 deletions(-) + 33 files changed, 176 insertions(+), 27 deletions(-) diff --git a/chrome/android/java/res/layout/custom_tabs_control_container.xml b/chrome/android/java/res/layout/custom_tabs_control_container.xml --- a/chrome/android/java/res/layout/custom_tabs_control_container.xml @@ -302,15 +302,16 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/Tab diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java --- a/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java -@@ -102,6 +102,7 @@ import org.chromium.chrome.browser.paint_preview.DemoPaintPreview; +@@ -102,6 +102,8 @@ import org.chromium.chrome.browser.paint_preview.DemoPaintPreview; import org.chromium.chrome.browser.password_manager.ManagePasswordsReferrer; import org.chromium.chrome.browser.password_manager.PasswordManagerLauncher; import org.chromium.chrome.browser.pdf.PdfPage; +import org.chromium.chrome.browser.preferences.ChromePreferenceKeys; ++import org.chromium.chrome.browser.preferences.ChromeSharedPreferences; import org.chromium.chrome.browser.price_insights.PriceInsightsButtonController; import org.chromium.chrome.browser.price_tracking.CurrentTabPriceTrackingStateSupplier; import org.chromium.chrome.browser.price_tracking.PriceTrackingButtonController; -@@ -1758,7 +1759,9 @@ public class RootUiCoordinator +@@ -1758,7 +1760,9 @@ public class RootUiCoordinator if (!mSupportsFindInPageSupplier.getAsBoolean()) return; int stubId = R.id.find_toolbar_stub; diff --git a/build/patches/Ask-for-restart-on-connection-change.patch b/build/patches/Ask-for-restart-on-connection-change.patch index 69f958fd0..700f77f3d 100644 --- a/build/patches/Ask-for-restart-on-connection-change.patch +++ b/build/patches/Ask-for-restart-on-connection-change.patch @@ -334,7 +334,7 @@ new file mode 100644 + +package org.chromium.chrome.browser.flags.cromite; + -+import org.chromium.base.cached_flags.CachedFlag; ++import org.chromium.components.cached_flags.CachedFlag; +import org.chromium.chrome.browser.flags.ChromeFeatureMap; + +public class sAskForRestartOnConnectionChange { diff --git a/build/patches/Bromite-subresource-adblocker.patch b/build/patches/Bromite-subresource-adblocker.patch index 426d0a4dc..67dfc4ba9 100644 --- a/build/patches/Bromite-subresource-adblocker.patch +++ b/build/patches/Bromite-subresource-adblocker.patch @@ -48,10 +48,10 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../content/shared/browser/ruleset_service.h | 8 +- .../unindexed_ruleset_stream_generator.cc | 3 + .../core/browser/ruleset_version.h | 4 + - .../browser/subresource_filter_features.cc | 111 +------ + .../browser/subresource_filter_features.cc | 114 +------ .../core/browser/verified_ruleset_dealer.cc | 4 + .../core/common/indexed_ruleset.cc | 5 +- - 39 files changed, 1272 insertions(+), 125 deletions(-) + 39 files changed, 1273 insertions(+), 127 deletions(-) create mode 100644 chrome/android/java/res/layout/adblock_editor.xml create mode 100644 chrome/android/java/res/xml/adblock_preferences.xml create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/settings/AdBlockEditor.java @@ -1816,7 +1816,7 @@ diff --git a/components/subresource_filter/core/browser/ruleset_version.h b/comp diff --git a/components/subresource_filter/core/browser/subresource_filter_features.cc b/components/subresource_filter/core/browser/subresource_filter_features.cc --- a/components/subresource_filter/core/browser/subresource_filter_features.cc +++ b/components/subresource_filter/core/browser/subresource_filter_features.cc -@@ -55,68 +55,6 @@ class CommaSeparatedStrings { +@@ -55,71 +55,8 @@ class CommaSeparatedStrings { const std::vector pieces_; }; @@ -1883,9 +1883,13 @@ diff --git a/components/subresource_filter/core/browser/subresource_filter_featu - return result; -} - std::vector FillEnabledPresetConfigurations( - std::map* params) { -@@ -127,23 +65,16 @@ std::vector FillEnabledPresetConfigurations( +-std::vector FillEnabledPresetConfigurations( +- std::map* params) { ++std::vector FillEnabledPresetConfigurations() { + // If ad tagging is enabled, turn on the dryrun automatically. + bool ad_tagging_enabled = base::FeatureList::IsEnabled(kAdTagging); + const struct { +@@ -127,23 +64,16 @@ std::vector FillEnabledPresetConfigurations( bool enabled_by_default; Configuration (*factory_method)(); } kAvailablePresetConfigurations[] = { @@ -1911,7 +1915,7 @@ diff --git a/components/subresource_filter/core/browser/subresource_filter_featu enabled_configurations.push_back(available_preset.factory_method()); } } -@@ -151,46 +82,10 @@ std::vector FillEnabledPresetConfigurations( +@@ -151,46 +81,10 @@ std::vector FillEnabledPresetConfigurations( return enabled_configurations; } diff --git a/build/patches/Chrome-web-store-protection.patch b/build/patches/Chrome-web-store-protection.patch index 2a675d54b..e01a196bf 100644 --- a/build/patches/Chrome-web-store-protection.patch +++ b/build/patches/Chrome-web-store-protection.patch @@ -29,7 +29,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html .../browser/resources/extensions/service.ts | 5 ++ .../browser/resources/extensions/toolbar.css | 5 ++ .../browser/resources/extensions/toolbar.html | 7 +++ - .../browser/resources/extensions/toolbar.ts | 20 +++++++ + .../browser/resources/extensions/toolbar.ts | 21 +++++++ .../resources/webstore_app/manifest.json | 7 +-- .../ui/webui/extensions/extensions_ui.cc | 8 +++ .../chrome_update_query_params_delegate.cc | 13 ++-- @@ -44,7 +44,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html extensions/common/extension_features.cc | 15 +++++ extensions/common/extension_features.h | 5 ++ .../definitions/developer_private.d.ts | 2 + - 31 files changed, 257 insertions(+), 103 deletions(-) + 31 files changed, 258 insertions(+), 103 deletions(-) create mode 100644 cromite_flags/chrome/browser/about_flags_cc/Webstore-protection.inc diff --git a/chrome/app/extensions_strings.grdp b/chrome/app/extensions_strings.grdp @@ -552,7 +552,15 @@ diff --git a/chrome/browser/resources/extensions/toolbar.ts b/chrome/browser/res /** Opens the dialog to load unpacked extensions. */ loadUnpacked(): Promise; -@@ -79,6 +81,13 @@ export class ExtensionsToolbarElement extends ExtensionsToolbarElementBase { +@@ -41,6 +43,7 @@ class DummyToolbarDelegate { + updateAllExtensions(_extensions: chrome.developerPrivate.ExtensionInfo[]) { + return Promise.resolve(); + } ++ setExtUpdateEnabled(_enabled: boolean) {} + } + + export interface ExtensionsToolbarElement { +@@ -79,6 +82,13 @@ export class ExtensionsToolbarElement extends ExtensionsToolbarElementBase { reflect: true, }, @@ -566,15 +574,15 @@ diff --git a/chrome/browser/resources/extensions/toolbar.ts b/chrome/browser/res devModeControlledByPolicy: {type: Boolean}, isChildAccount: {type: Boolean}, -@@ -91,6 +100,7 @@ export class ExtensionsToolbarElement extends ExtensionsToolbarElementBase { +@@ -91,6 +101,7 @@ export class ExtensionsToolbarElement extends ExtensionsToolbarElementBase { expanded_: {type: Boolean}, showPackDialog_: {type: Boolean}, -+ shouldShowRelaunchDialog: Boolean, ++ shouldShowRelaunchDialog: {type: Boolean}, /** * Prevents initiating update while update is in progress. -@@ -102,6 +112,8 @@ export class ExtensionsToolbarElement extends ExtensionsToolbarElementBase { +@@ -102,6 +113,8 @@ export class ExtensionsToolbarElement extends ExtensionsToolbarElementBase { extensions: chrome.developerPrivate.ExtensionInfo[] = []; delegate: ToolbarDelegate = new DummyToolbarDelegate(); inDevMode: boolean = false; @@ -583,7 +591,7 @@ diff --git a/chrome/browser/resources/extensions/toolbar.ts b/chrome/browser/res devModeControlledByPolicy: boolean = false; isChildAccount: boolean = false; -@@ -154,6 +166,14 @@ export class ExtensionsToolbarElement extends ExtensionsToolbarElementBase { +@@ -154,6 +167,14 @@ export class ExtensionsToolbarElement extends ExtensionsToolbarElementBase { 'Options_ToggleDeveloperMode_' + (e.detail ? 'Enabled' : 'Disabled')); } diff --git a/build/patches/Customize-selection-popup.patch b/build/patches/Customize-selection-popup.patch index 44e417f74..9630c63dd 100644 --- a/build/patches/Customize-selection-popup.patch +++ b/build/patches/Customize-selection-popup.patch @@ -53,7 +53,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedAct + if (!showToast && !selectionPopupTabsForeground) { + showToast = !DeviceClassManager.enableAnimations() && + (type == TabLaunchType.FROM_LONGPRESS_BACKGROUND -+ || (type == TabLaunchType.FROM_LONGPRESS_BACKGROUND_IN_GROUP); ++ || type == TabLaunchType.FROM_LONGPRESS_BACKGROUND_IN_GROUP); + } + if (showToast) { Toast.makeText( @@ -138,7 +138,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordi import org.chromium.base.TraceEvent; import org.chromium.base.lifetime.Destroyable; import org.chromium.base.metrics.RecordUserAction; -@@ -823,11 +824,16 @@ public class RootUiCoordinator +@@ -824,11 +825,16 @@ public class RootUiCoordinator TrackerFactory.getTrackerForProfile(tab.getProfile()) .notifyEvent(EventConstants.WEB_SEARCH_PERFORMED); diff --git a/build/patches/Disable-Android-AppRestrictions.patch b/build/patches/Disable-Android-AppRestrictions.patch index 4c4ea8299..80e37575d 100644 --- a/build/patches/Disable-Android-AppRestrictions.patch +++ b/build/patches/Disable-Android-AppRestrictions.patch @@ -86,7 +86,7 @@ new file mode 100644 + +package org.chromium.chrome.browser.flags.cromite; + -+import org.chromium.base.cached_flags.CachedFlag; ++import org.chromium.components.cached_flags.CachedFlag; +import org.chromium.chrome.browser.flags.ChromeFeatureMap; +import org.chromium.components.policy.AppRestrictionsProvider; + diff --git a/build/patches/Disable-Compose-feature.patch b/build/patches/Disable-Compose-feature.patch index af6fe6f5a..ef31e4188 100644 --- a/build/patches/Disable-Compose-feature.patch +++ b/build/patches/Disable-Compose-feature.patch @@ -4,10 +4,57 @@ Subject: Disable Compose feature License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html --- + chrome/browser/BUILD.gn | 9 +++++++-- + chrome/browser/ui/webui/settings/settings_ui.cc | 2 +- components/compose/core/browser/compose_features.cc | 2 ++ components/compose/features.gni | 2 +- - 2 files changed, 3 insertions(+), 1 deletion(-) + 4 files changed, 11 insertions(+), 4 deletions(-) +diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn +--- a/chrome/browser/BUILD.gn ++++ b/chrome/browser/BUILD.gn +@@ -8386,6 +8386,12 @@ static_library("browser") { + deps += [ "//components/segmentation_platform/internal:optimization_guide_segmentation_handler" ] + } + ++ if (!is_android) { ++ deps += [ ++ ":compose_optimization_guide_proto", ++ ] ++ } ++ + if (enable_compose) { + sources += [ + "compose/chrome_compose_client.cc", +@@ -8401,7 +8407,6 @@ static_library("browser") { + ] + + deps += [ +- ":compose_optimization_guide_proto", + "//chrome/common/compose", + "//chrome/common/compose:mojo_bindings", + "//components/autofill/content/browser:browser", +@@ -8842,7 +8847,7 @@ source_set("font_pref") { + deps = [ "//chrome/common" ] + } + +-if (enable_compose) { ++if (!is_android) { + proto_library("compose_optimization_guide_proto") { + sources = [ "compose/proto/compose_optimization_guide.proto" ] + cc_generator_options = "lite=true:" +diff --git a/chrome/browser/ui/webui/settings/settings_ui.cc b/chrome/browser/ui/webui/settings/settings_ui.cc +--- a/chrome/browser/ui/webui/settings/settings_ui.cc ++++ b/chrome/browser/ui/webui/settings/settings_ui.cc +@@ -586,7 +586,7 @@ SettingsUI::SettingsUI(content::WebUI* web_ui) + optimization_guide::features::kAiSettingsPageRefresh); + + if (ai_settings_refresh_enabled) { +- const bool compose_enabled = ComposeEnabling::IsEnabledForProfile(profile); ++ const bool compose_enabled = false; + const bool tab_organization_enabled = + TabOrganizationUtils::GetInstance()->IsEnabled(profile); + const bool wallpaper_search_enabled = diff --git a/components/compose/core/browser/compose_features.cc b/components/compose/core/browser/compose_features.cc --- a/components/compose/core/browser/compose_features.cc +++ b/components/compose/core/browser/compose_features.cc diff --git a/build/patches/Disable-all-predictors-code.patch b/build/patches/Disable-all-predictors-code.patch index 164315ab5..2dac667ca 100644 --- a/build/patches/Disable-all-predictors-code.patch +++ b/build/patches/Disable-all-predictors-code.patch @@ -34,13 +34,13 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../Disable-all-predictors-code.inc | 3 +++ .../Disable-all-predictors-code.inc | 1 + .../Disable-all-predictors-code.inc | 1 + - .../features_cc/Disable-all-predictors-code.inc | 4 ++++ + .../features_cc/Disable-all-predictors-code.inc | 3 +++ .../features_cc/Disable-all-predictors-code.inc | 1 + .../features_cc/Disable-all-predictors-code.inc | 2 ++ services/webnn/features.gni | 2 +- .../document_speculation_rules.cc | 1 + .../platform/runtime_enabled_features.json5 | 2 +- - 35 files changed, 97 insertions(+), 35 deletions(-) + 35 files changed, 96 insertions(+), 35 deletions(-) create mode 100644 cromite_flags/chrome/browser/browser_features_cc/Disable-all-predictors-code.inc create mode 100644 cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/Disable-all-predictors-code.inc create mode 100644 cromite_flags/chrome/common/chrome_features_cc/Disable-all-predictors-code.inc @@ -698,8 +698,7 @@ diff --git a/cromite_flags/components/permissions/features_cc/Disable-all-predic new file mode 100644 --- /dev/null +++ b/cromite_flags/components/permissions/features_cc/Disable-all-predictors-code.inc -@@ -0,0 +1,4 @@ -+SET_CROMITE_FEATURE_DISABLED(kPermissionPredictionServiceUseUrlOverride); +@@ -0,0 +1,3 @@ +SET_CROMITE_FEATURE_DISABLED(kPermissionOnDeviceNotificationPredictions); +SET_CROMITE_FEATURE_DISABLED(kPermissionOnDeviceGeolocationPredictions); +SET_CROMITE_FEATURE_DISABLED(kPermissionPredictionsV2); diff --git a/build/patches/Disable-conversion-measurement-api.patch b/build/patches/Disable-conversion-measurement-api.patch index 8b8d7e79b..04c496da9 100644 --- a/build/patches/Disable-conversion-measurement-api.patch +++ b/build/patches/Disable-conversion-measurement-api.patch @@ -36,8 +36,8 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../network/public/cpp/attribution_utils.cc | 2 + third_party/blink/renderer/core/page/page.cc | 2 +- .../platform/runtime_enabled_features.json5 | 10 +- - ui/events/android/motion_event_android.cc | 6 +- - 26 files changed, 77 insertions(+), 381 deletions(-) + ui/events/android/motion_event_android.cc | 8 +- + 26 files changed, 78 insertions(+), 382 deletions(-) create mode 100644 cromite_flags/services/network/public/cpp/features_cc/Disable-conversion-measurement-api.inc create mode 100644 cromite_flags/third_party/blink/common/features_cc/Disable-conversion-measurement-api.inc @@ -935,17 +935,19 @@ diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 diff --git a/ui/events/android/motion_event_android.cc b/ui/events/android/motion_event_android.cc --- a/ui/events/android/motion_event_android.cc +++ b/ui/events/android/motion_event_android.cc -@@ -389,7 +389,11 @@ MotionEventAndroid::ToolType MotionEventAndroid::FromAndroidToolType( +@@ -389,8 +389,12 @@ MotionEventAndroid::ToolType MotionEventAndroid::FromAndroidToolType( #undef TOOL_TYPE_CASE base::TimeTicks MotionEventAndroid::FromAndroidTime(base::TimeTicks time) { - ValidateEventTimeClock(&time); +- return time; + base::TimeTicks timestamp; + // Rounding down to milliseconds (from nanoseconds) + // see https://bugs.chromium.org/p/chromium/issues/detail?id=1378615 + timestamp = base::TimeTicks::FromUptimeMillis(time.ToUptimeMillis()); + ValidateEventTimeClock(×tamp); - return time; ++ return timestamp; } + float MotionEventAndroid::ToValidFloat(float x) { -- diff --git a/build/patches/Enable-Android-Dynamic-Performance-Framework.patch b/build/patches/Enable-Android-Dynamic-Performance-Framework.patch index 166303850..4b14d521b 100644 --- a/build/patches/Enable-Android-Dynamic-Performance-Framework.patch +++ b/build/patches/Enable-Android-Dynamic-Performance-Framework.patch @@ -6,8 +6,8 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html --- chrome/version.gni | 4 ++-- components/viz/common/features.cc | 2 ++ - components/viz/service/performance_hint/hint_session.cc | 3 +++ - 3 files changed, 7 insertions(+), 2 deletions(-) + components/viz/service/performance_hint/hint_session.cc | 5 +---- + 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/chrome/version.gni b/chrome/version.gni --- a/chrome/version.gni @@ -48,14 +48,22 @@ diff --git a/components/viz/common/features.cc b/components/viz/common/features. diff --git a/components/viz/service/performance_hint/hint_session.cc b/components/viz/service/performance_hint/hint_session.cc --- a/components/viz/service/performance_hint/hint_session.cc +++ b/components/viz/service/performance_hint/hint_session.cc -@@ -267,6 +267,9 @@ bool IsAdpfEnabled() { - return base::Contains(allowlist, soc); - } +@@ -240,16 +240,13 @@ bool IsAdpfEnabled() { + switches::kDisableAdpf)) { + return false; + } +- if (base::android::BuildInfo::GetInstance()->sdk_int() < +- base::android::SDK_VERSION_S) { +- return false; +- } + if (!AdpfMethods::Get().supported) { + return false; + } + if (!base::FeatureList::IsEnabled(features::kAdpf)) { + return false; + } ++ if ((true)) return true; -+// Notify me when this is introduced -+[[maybe_unused]] void IsAdpfEnabled() {} -+ - } // namespace - - // static + std::string allowlist_param = features::kADPFSocManufacturerAllowlist.Get(); + std::vector allowlist = base::SplitStringPiece( -- diff --git a/build/patches/Enable-ImprovedBookmarks-by-default.patch b/build/patches/Enable-ImprovedBookmarks-by-default.patch index dac94f1d6..b67ce08af 100644 --- a/build/patches/Enable-ImprovedBookmarks-by-default.patch +++ b/build/patches/Enable-ImprovedBookmarks-by-default.patch @@ -7,11 +7,9 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html chrome/android/java/res/layout/bookmark_search_box_row.xml | 4 ++-- .../browser/bookmarks/BookmarkSearchBoxRowViewBinder.java | 2 ++ .../chromium/chrome/browser/bookmarks/BookmarkUiPrefs.java | 2 +- - .../org/chromium/chrome/browser/bookmarks/BookmarkUtils.java | 3 ++- + .../org/chromium/chrome/browser/bookmarks/BookmarkUtils.java | 2 +- components/bookmarks/browser/bookmark_node.cc | 3 +-- - .../Enable-ImprovedBookmarks-by-default.inc | 1 + - 6 files changed, 9 insertions(+), 6 deletions(-) - create mode 100644 cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/Enable-ImprovedBookmarks-by-default.inc + 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/chrome/android/java/res/layout/bookmark_search_box_row.xml b/chrome/android/java/res/layout/bookmark_search_box_row.xml --- a/chrome/android/java/res/layout/bookmark_search_box_row.xml @@ -61,15 +59,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUtils.java --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUtils.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkUtils.java -@@ -39,6 +39,7 @@ import org.chromium.chrome.browser.IntentHandler; - import org.chromium.chrome.browser.app.bookmarks.BookmarkActivity; - import org.chromium.chrome.browser.app.bookmarks.BookmarkEditActivity; - import org.chromium.chrome.browser.app.bookmarks.BookmarkFolderPickerActivity; -+import org.chromium.chrome.browser.bookmarks.BookmarkFeatures; - import org.chromium.chrome.browser.bookmarks.BookmarkUiPrefs.BookmarkRowDisplayPref; - import org.chromium.chrome.browser.commerce.ShoppingServiceFactory; - import org.chromium.chrome.browser.document.ChromeLauncherActivity; -@@ -562,7 +563,7 @@ public class BookmarkUtils { +@@ -562,7 +562,7 @@ public class BookmarkUtils { RecordUserAction.record("MobileBookmarkManagerReopenBookmarksInSameSession"); } @@ -91,10 +81,4 @@ diff --git a/components/bookmarks/browser/bookmark_node.cc b/components/bookmark case BookmarkNode::MOBILE: // Either MOBILE or OTHER_NODE is visible when empty, but never both. return !IsTypeVisibleWhenEmpty(BookmarkNode::OTHER_NODE); -diff --git a/cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/Enable-ImprovedBookmarks-by-default.inc b/cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/Enable-ImprovedBookmarks-by-default.inc -new file mode 100644 ---- /dev/null -+++ b/cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/Enable-ImprovedBookmarks-by-default.inc -@@ -0,0 +1 @@ -+SET_CROMITE_FEATURE_ENABLED(kAndroidImprovedBookmarks); -- diff --git a/build/patches/Enable-native-Android-autofill.patch b/build/patches/Enable-native-Android-autofill.patch index 6e0190935..fbbff2b7a 100644 --- a/build/patches/Enable-native-Android-autofill.patch +++ b/build/patches/Enable-native-Android-autofill.patch @@ -824,7 +824,7 @@ diff --git a/components/autofill/content/renderer/autofill_agent.cc b/components } // Password field elements should only have suggestions shown by the -@@ -1294,12 +1298,14 @@ void AutofillAgent::ShowSuggestions( +@@ -1294,11 +1298,13 @@ void AutofillAgent::ShowSuggestions( // `FormControlTypeForAutofill()` because we are interested in whether the // field is *currently* a password field, not whether it has ever been a // password field. @@ -834,11 +834,10 @@ diff --git a/components/autofill/content/renderer/autofill_agent.cc b/components !config_.query_password_suggestions) { return; } - } +#endif + } QueryAutofillSuggestions(element, trigger_source); - } diff --git a/components/autofill/content/renderer/password_autofill_agent.cc b/components/autofill/content/renderer/password_autofill_agent.cc --- a/components/autofill/content/renderer/password_autofill_agent.cc +++ b/components/autofill/content/renderer/password_autofill_agent.cc diff --git a/build/patches/Enable-search-engine-settings-desktop-ui.patch b/build/patches/Enable-search-engine-settings-desktop-ui.patch index ab3830972..2eba7b062 100644 --- a/build/patches/Enable-search-engine-settings-desktop-ui.patch +++ b/build/patches/Enable-search-engine-settings-desktop-ui.patch @@ -28,7 +28,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html chrome/browser/search/background/BUILD.gn | 4 +- .../browser/search_engines/android/BUILD.gn | 2 + .../java/res/layout/search_engine_layout.xml | 25 ++ - .../settings/SearchEngineSettings.java | 20 ++ + .../settings/SearchEngineSettings.java | 21 ++ chrome/browser/ui/BUILD.gn | 18 ++ .../edit_search_engine_controller.cc | 8 +- .../edit_search_engine_controller.h | 6 +- @@ -36,7 +36,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html .../keyword_editor_controller.h | 6 +- .../template_url_table_model.cc | 9 +- .../search_engines/template_url_table_model.h | 6 +- - .../webui/chrome_web_ui_controller_factory.cc | 7 + + .../webui/chrome_web_ui_controller_factory.cc | 7 +- chrome/browser/ui/webui/favicon_source.cc | 18 ++ chrome/browser/ui/webui/favicon_source.h | 2 + .../webui/settings/search_engines_handler.cc | 28 +- @@ -57,20 +57,24 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html content/browser/webui/web_ui_impl.cc | 14 +- content/browser/webui/web_ui_impl.h | 3 + content/public/browser/web_ui.h | 1 + - third_party/polymer/v3_0/BUILD.gn | 6 + + third_party/polymer/v3_0/BUILD.gn | 15 +- ui/base/template_expressions.cc | 21 +- ui/webui/BUILD.gn | 7 + - ui/webui/resources/BUILD.gn | 10 + + ui/webui/resources/BUILD.gn | 20 ++ .../customize_color_scheme_mode/BUILD.gn | 2 +- .../cr_components/help_bubble/BUILD.gn | 2 +- + .../cr_components/localized_link/BUILD.gn | 2 +- + .../cr_components/managed_dialog/BUILD.gn | 2 +- + .../cr_components/managed_footnote/BUILD.gn | 2 +- .../cr_components/theme_color_picker/BUILD.gn | 2 +- + ui/webui/resources/cr_elements/BUILD.gn | 4 +- .../cr_elements/cr_dialog/cr_dialog.css | 2 +- .../resources/cr_elements/cr_shared_vars.css | 4 + ui/webui/resources/css/BUILD.gn | 2 +- ui/webui/resources/images/BUILD.gn | 2 +- ui/webui/resources/js/BUILD.gn | 2 +- ui/webui/resources/js/load_time_data.ts | 17 +- - 63 files changed, 1095 insertions(+), 62 deletions(-) + 67 files changed, 1118 insertions(+), 69 deletions(-) create mode 100644 chrome/app/settings_strings_android.grdp create mode 100644 chrome/browser/search_engines/android/java/res/layout/search_engine_layout.xml create mode 100644 chrome/browser/ui/webui/settings/settings_localized_strings_provider_android.cc @@ -827,12 +831,12 @@ diff --git a/chrome/browser/search_engines/android/java/src/org/chromium/chrome/ import org.chromium.chrome.browser.search_engines.R; import org.chromium.chrome.browser.search_engines.TemplateUrlServiceFactory; import org.chromium.chrome.browser.settings.ProfileDependentSetting; -+import org.chromium.chrome.browser.settings.SettingsLauncherFactory; -+import org.chromium.components.browser_ui.settings.SettingsLauncher; ++import org.chromium.chrome.browser.settings.SettingsNavigationFactory; ++import org.chromium.components.browser_ui.settings.SettingsNavigation; import org.chromium.components.browser_ui.settings.EmbeddableSettingsPage; import org.chromium.components.search_engines.TemplateUrlService; -@@ -57,6 +63,20 @@ public class SearchEngineSettings extends ListFragment +@@ -57,6 +63,21 @@ public class SearchEngineSettings extends ListFragment return mPageTitle; } @@ -843,8 +847,9 @@ diff --git a/chrome/browser/search_engines/android/java/src/org/chromium/chrome/ + + TextView selectButton = (TextView) v.findViewById(R.id.open_desktop_ui); + selectButton.setOnClickListener(view -> { -+ SettingsLauncher settingsLauncher = SettingsLauncherFactory.createSettingsLauncher(); -+ settingsLauncher.launchUrlInCustomTab(getContext(), ++ SettingsNavigation settingsNavigation = ++ SettingsNavigationFactory.createSettingsNavigation(); ++ settingsNavigation.launchUrlInCustomTab(getContext(), + "chrome://settings/searchEngines"); + }); + return v; @@ -1080,18 +1085,18 @@ diff --git a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc b/chrom #else // BUILDFLAG(IS_ANDROID) #include "chrome/browser/media/router/discovery/access_code/access_code_cast_feature.h" #include "chrome/browser/ui/ui_features.h" -@@ -522,6 +524,11 @@ base::RefCountedMemory* ChromeWebUIControllerFactory::GetFaviconResourceBytes( - return settings_utils::GetFaviconResourceBytes(scale_factor); - #endif // BUILDFLAG(IS_CHROMEOS_ASH) - +@@ -270,7 +272,10 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui, + if (url.host_piece() == user_scripts::kChromeUIUserScriptsHost) + return &NewWebUI; + #endif +- +#if BUILDFLAG(IS_ANDROID) + if (url.host_piece() == chrome::kChromeUISettingsHost) + return &NewWebUI; +#endif // BUILDFLAG(IS_ANDROID) -+ - return nullptr; - } - + #if !BUILDFLAG(IS_ANDROID) + if (url.host_piece() == chrome::kChromeUINewTabHost) { + // The URL chrome://newtab/ can be either a virtual or a real URL, diff --git a/chrome/browser/ui/webui/favicon_source.cc b/chrome/browser/ui/webui/favicon_source.cc --- a/chrome/browser/ui/webui/favicon_source.cc +++ b/chrome/browser/ui/webui/favicon_source.cc @@ -2028,7 +2033,16 @@ diff --git a/content/public/browser/web_ui.h b/content/public/browser/web_ui.h diff --git a/third_party/polymer/v3_0/BUILD.gn b/third_party/polymer/v3_0/BUILD.gn --- a/third_party/polymer/v3_0/BUILD.gn +++ b/third_party/polymer/v3_0/BUILD.gn -@@ -31,6 +31,12 @@ js_files = [ +@@ -8,7 +8,7 @@ import("//tools/typescript/ts_library.gni") + import("//ui/webui/resources/tools/generate_grd.gni") + import("//ui/webui/resources/tools/minify_js.gni") + +-assert(!is_android && !is_ios) ++#assert(!is_android && !is_ios) + + js_files = [ + "iron-a11y-keys-behavior/iron-a11y-keys-behavior.js", +@@ -31,12 +31,25 @@ js_files = [ "paper-spinner/paper-spinner-styles.js", ] @@ -2041,6 +2055,19 @@ diff --git a/third_party/polymer/v3_0/BUILD.gn b/third_party/polymer/v3_0/BUILD. # Also needed on LaCros for Print Preview. Remove once CrOS Print Preview # launches. if (is_chromeos) { + js_files += [ "iron-fit-behavior/iron-fit-behavior.js" ] + } + ++if (is_android) { ++ js_files += [ ++ "iron-icon/iron-icon.js", ++ "iron-iconset-svg/iron-iconset-svg.js", ++ ] ++} ++ + if (is_chromeos_ash) { + js_files += [ + "iron-a11y-announcer/iron-a11y-announcer.js", diff --git a/ui/base/template_expressions.cc b/ui/base/template_expressions.cc --- a/ui/base/template_expressions.cc +++ b/ui/base/template_expressions.cc @@ -2101,23 +2128,33 @@ diff --git a/ui/webui/BUILD.gn b/ui/webui/BUILD.gn diff --git a/ui/webui/resources/BUILD.gn b/ui/webui/resources/BUILD.gn --- a/ui/webui/resources/BUILD.gn +++ b/ui/webui/resources/BUILD.gn -@@ -76,6 +76,16 @@ generate_grd("build_grd") { - "$target_gen_dir/cr_components/managed_footnote/resources.grdp", - "$target_gen_dir/cr_components/most_visited/resources.grdp", - ] -+ if (is_android) { -+ public_deps -= [ -+ "cr_components/app_management:build_grdp", -+ "cr_components/most_visited:build_grdp", -+ ] -+ grdp_files -= [ -+ "$target_gen_dir/cr_components/app_management/resources.grdp", -+ "$target_gen_dir/cr_components/most_visited/resources.grdp", -+ ] -+ } +@@ -51,6 +51,26 @@ generate_grd("build_grd") { + "$target_gen_dir/mojo/resources.grdp", + ] - if (use_blink) { - if (use_nss_certs || chrome_root_store_cert_management_ui) { ++ if (is_android) { ++ public_deps += [ ++ "cr_components/customize_color_scheme_mode:build_grdp", ++ "cr_components/help_bubble:build_grdp", ++ "cr_components/localized_link:build_grdp", ++ "cr_components/managed_dialog:build_grdp", ++ "cr_components/managed_footnote:build_grdp", ++ "cr_components/theme_color_picker:build_grdp", ++ "//third_party/polymer/v3_0:build_grdp", ++ ] ++ grdp_files += [ ++ "$target_gen_dir/cr_components/customize_color_scheme_mode/resources.grdp", ++ "$target_gen_dir/cr_components/help_bubble/resources.grdp", ++ "$target_gen_dir/cr_components/localized_link/resources.grdp", ++ "$target_gen_dir/cr_components/managed_dialog/resources.grdp", ++ "$target_gen_dir/cr_components/managed_footnote/resources.grdp", ++ "$target_gen_dir/cr_components/theme_color_picker/resources.grdp", ++ "$root_gen_dir/third_party/polymer/v3_0/polymer_3_0_resources.grdp", ++ ] ++ } + if (!is_android && !is_ios) { + public_deps += [ + "cr_components/app_management:build_grdp", diff --git a/ui/webui/resources/cr_components/customize_color_scheme_mode/BUILD.gn b/ui/webui/resources/cr_components/customize_color_scheme_mode/BUILD.gn --- a/ui/webui/resources/cr_components/customize_color_scheme_mode/BUILD.gn +++ b/ui/webui/resources/cr_components/customize_color_scheme_mode/BUILD.gn @@ -2142,6 +2179,42 @@ diff --git a/ui/webui/resources/cr_components/help_bubble/BUILD.gn b/ui/webui/re mojom("mojo_bindings") { sources = [ "help_bubble.mojom" ] +diff --git a/ui/webui/resources/cr_components/localized_link/BUILD.gn b/ui/webui/resources/cr_components/localized_link/BUILD.gn +--- a/ui/webui/resources/cr_components/localized_link/BUILD.gn ++++ b/ui/webui/resources/cr_components/localized_link/BUILD.gn +@@ -4,7 +4,7 @@ + + import("//ui/webui/resources/tools/build_webui.gni") + +-assert(!is_android && !is_ios) ++#assert(!is_android && !is_ios) + + build_webui("build") { + grd_prefix = "cr_components_localized_link" +diff --git a/ui/webui/resources/cr_components/managed_dialog/BUILD.gn b/ui/webui/resources/cr_components/managed_dialog/BUILD.gn +--- a/ui/webui/resources/cr_components/managed_dialog/BUILD.gn ++++ b/ui/webui/resources/cr_components/managed_dialog/BUILD.gn +@@ -4,7 +4,7 @@ + + import("//ui/webui/resources/tools/build_webui.gni") + +-assert(!is_android && !is_ios) ++#assert(!is_android && !is_ios) + + build_webui("build") { + grd_prefix = "cr_components_managed_dialog" +diff --git a/ui/webui/resources/cr_components/managed_footnote/BUILD.gn b/ui/webui/resources/cr_components/managed_footnote/BUILD.gn +--- a/ui/webui/resources/cr_components/managed_footnote/BUILD.gn ++++ b/ui/webui/resources/cr_components/managed_footnote/BUILD.gn +@@ -4,7 +4,7 @@ + + import("//ui/webui/resources/tools/build_webui.gni") + +-assert(!is_android && !is_ios) ++#assert(!is_android && !is_ios) + + build_webui("build") { + grd_prefix = "cr_components_managed_footnote" diff --git a/ui/webui/resources/cr_components/theme_color_picker/BUILD.gn b/ui/webui/resources/cr_components/theme_color_picker/BUILD.gn --- a/ui/webui/resources/cr_components/theme_color_picker/BUILD.gn +++ b/ui/webui/resources/cr_components/theme_color_picker/BUILD.gn @@ -2154,6 +2227,27 @@ diff --git a/ui/webui/resources/cr_components/theme_color_picker/BUILD.gn b/ui/w mojom("mojom") { sources = [ "theme_color_picker.mojom" ] +diff --git a/ui/webui/resources/cr_elements/BUILD.gn b/ui/webui/resources/cr_elements/BUILD.gn +--- a/ui/webui/resources/cr_elements/BUILD.gn ++++ b/ui/webui/resources/cr_elements/BUILD.gn +@@ -37,7 +37,7 @@ build_webui("build") { + "cr_tabs/cr_tabs.css", + ] + +- if (!is_android && !is_ios) { ++ if (!is_ios) { + web_component_files += [ "cr_a11y_announcer/cr_a11y_announcer.ts" ] + + icons_html_files = [ +@@ -233,7 +233,7 @@ build_webui("build") { + "../js:build_ts", + "//third_party/lit/v3_0:build_ts", + ] +- if (!is_android && !is_ios) { ++ if (!is_ios) { + ts_deps += [ "//third_party/polymer/v3_0:library" ] + } + ts_definitions = [ diff --git a/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.css b/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.css --- a/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.css +++ b/ui/webui/resources/cr_elements/cr_dialog/cr_dialog.css diff --git a/build/patches/Enables-deactivation-of-the-js-debugger-statement.patch b/build/patches/Enables-deactivation-of-the-js-debugger-statement.patch index 142fd5514..9af76ddbe 100644 --- a/build/patches/Enables-deactivation-of-the-js-debugger-statement.patch +++ b/build/patches/Enables-deactivation-of-the-js-debugger-statement.patch @@ -325,7 +325,7 @@ diff --git a/v8/src/runtime/runtime-debug.cc b/v8/src/runtime/runtime-debug.cc + Handle message = + MessageHandler::MakeMessageObject( + isolate, MessageTemplate::kDebuggerStatementSuppressed, location, -+ isolate->factory()->null_value(), Handle::null()); ++ isolate->factory()->null_value(), DirectHandle::null()); + message->set_error_level(v8::Isolate::kMessageWarning); + MessageHandler::ReportMessage(isolate, location, message); + } diff --git a/build/patches/Experimental-user-scripts-support.patch b/build/patches/Experimental-user-scripts-support.patch index fdd08dbba..21ef6a645 100644 --- a/build/patches/Experimental-user-scripts-support.patch +++ b/build/patches/Experimental-user-scripts-support.patch @@ -40,7 +40,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html chrome/browser/profiles/profile_manager.cc | 11 + chrome/browser/profiles/renderer_updater.cc | 19 +- chrome/browser/profiles/renderer_updater.h | 3 + - .../webui/chrome_web_ui_controller_factory.cc | 5 + + .../webui/chrome_web_ui_controller_factory.cc | 6 + chrome/chrome_paks.gni | 2 + chrome/common/renderer_configuration.mojom | 1 + chrome/renderer/BUILD.gn | 6 + @@ -74,7 +74,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../user-script-ui/user-scripts-ui.js | 9 + .../browser/ui/user_scripts_ui.cc | 146 ++++ .../user_scripts/browser/ui/user_scripts_ui.h | 37 + - .../browser/user_script_loader.cc | 704 +++++++++++++++ + .../browser/user_script_loader.cc | 702 +++++++++++++++ .../user_scripts/browser/user_script_loader.h | 168 ++++ .../browser/user_script_pref_info.cc | 34 + .../browser/user_script_pref_info.h | 72 ++ @@ -135,7 +135,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../Experimental-user-scripts-support.inc | 13 + ipc/ipc_message_start.h | 1 + tools/gritsettings/resource_ids.spec | 6 + - 108 files changed, 9483 insertions(+), 2 deletions(-) + 108 files changed, 9482 insertions(+), 2 deletions(-) create mode 100644 components/user_scripts/README.md create mode 100755 components/user_scripts/android/BUILD.gn create mode 100644 components/user_scripts/android/java/res/layout/accept_script_item.xml @@ -509,17 +509,18 @@ diff --git a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc b/chrom #include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h" #include "content/public/common/content_client.h" -@@ -262,6 +263,10 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui, - history_clusters_internals::kChromeUIHistoryClustersInternalsHost) { - return &NewWebUI; +@@ -265,6 +266,11 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui, + if (url.host_piece() == chrome::kChromeUIProxyConfigHost) { + return &NewWebUI; } +#if BUILDFLAG(IS_ANDROID) + if (url.host_piece() == user_scripts::kChromeUIUserScriptsHost) + return &NewWebUI; +#endif - ++ #if !BUILDFLAG(IS_ANDROID) if (url.host_piece() == chrome::kChromeUINewTabHost) { + // The URL chrome://newtab/ can be either a virtual or a real URL, diff --git a/chrome/chrome_paks.gni b/chrome/chrome_paks.gni --- a/chrome/chrome_paks.gni +++ b/chrome/chrome_paks.gni @@ -1262,9 +1263,8 @@ new file mode 100755 +import org.chromium.base.IntentUtils; + +import org.chromium.chrome.browser.IntentHandler; -+import org.chromium.chrome.browser.settings.SettingsLauncherFactory; -+import org.chromium.chrome.browser.settings.SettingsLauncherImpl; -+import org.chromium.components.browser_ui.settings.SettingsLauncher; ++import org.chromium.chrome.browser.settings.SettingsNavigationFactory; ++import org.chromium.components.browser_ui.settings.SettingsNavigation; + +import org.chromium.components.user_scripts.UserScriptsPreferences; +import org.chromium.components.user_scripts.UserScriptsBridge; @@ -1300,8 +1300,9 @@ new file mode 100755 + + if (visibleName.toUpperCase().endsWith(".USER.JS") == false) return false; + -+ SettingsLauncher settingsLauncher = SettingsLauncherFactory.createSettingsLauncher(); -+ Intent intent = settingsLauncher.createSettingsActivityIntent( ++ SettingsNavigation settingsNavigation = ++ SettingsNavigationFactory.createSettingsNavigation(); ++ Intent intent = settingsNavigation.createSettingsIntent( + context, UserScriptsPreferences.class, + UserScriptsPreferences.createFragmentArgsForInstall(filePath)); + IntentUtils.safeStartActivity(context, intent); @@ -2834,7 +2835,7 @@ diff --git a/components/user_scripts/browser/user_script_loader.cc b/components/ new file mode 100755 --- /dev/null +++ b/components/user_scripts/browser/user_script_loader.cc -@@ -0,0 +1,704 @@ +@@ -0,0 +1,702 @@ +/* + This file is part of Bromite. + @@ -3048,13 +3049,11 @@ new file mode 100755 + + base::File infile; + if (user_script_path.IsContentUri()) { -+ if (base::FeatureList::IsEnabled(features::kEnableLoggingUserScripts)) ++ if (base::FeatureList::IsEnabled(features::kEnableLoggingUserScripts)) { + LOG(INFO) << "UserScriptLoader: path " << user_script_path << " is a content uri"; -+ -+ infile = OpenContentUri(user_script_path, base::File::FLAG_OPEN | base::File::FLAG_READ); -+ } else { -+ infile = base::File(user_script_path, base::File::FLAG_OPEN | base::File::FLAG_READ); ++ } + } ++ infile = base::File(user_script_path, base::File::FLAG_OPEN | base::File::FLAG_READ); + + if (!infile.IsValid()) { + base::File::Error out_error = infile.error_details(); diff --git a/build/patches/History-number-of-days-privacy-setting.patch b/build/patches/History-number-of-days-privacy-setting.patch index 4b39f6186..c26b1626c 100644 --- a/build/patches/History-number-of-days-privacy-setting.patch +++ b/build/patches/History-number-of-days-privacy-setting.patch @@ -32,8 +32,9 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../history/core/browser/history_service.h | 8 +++ components/history/core/common/pref_names.cc | 4 ++ components/history/core/common/pref_names.h | 1 + + components/history_embeddings/sql_database.cc | 2 +- .../omnibox/browser/shortcuts_backend.cc | 4 +- - 23 files changed, 259 insertions(+), 13 deletions(-) + 24 files changed, 260 insertions(+), 14 deletions(-) create mode 100644 components/cromite_components_strings_grd/History-number-of-days-privacy-setting.grdp diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml @@ -624,6 +625,18 @@ diff --git a/components/history/core/common/pref_names.h b/components/history/co extern const char kAllowDeletingBrowserHistory[]; } // namespace prefs +diff --git a/components/history_embeddings/sql_database.cc b/components/history_embeddings/sql_database.cc +--- a/components/history_embeddings/sql_database.cc ++++ b/components/history_embeddings/sql_database.cc +@@ -175,7 +175,7 @@ sql::InitStatus SqlDatabase::InitInternal(const base::FilePath& storage_dir, + // Chrome is running, but it's possible to miss events or start Chrome after + // some down time, so this prevents long term accidental retention edge cases. + DeleteExpiredData(/*expiration_time=*/base::Time::Now() - +- base::Days(history::HistoryBackend::kExpireDaysThreshold)); ++ base::Days(90)); + + // It's possible to get here without `embedder_metadata_` if forcing for + // data deletion. In that case, don't check or change meta table. diff --git a/components/omnibox/browser/shortcuts_backend.cc b/components/omnibox/browser/shortcuts_backend.cc --- a/components/omnibox/browser/shortcuts_backend.cc +++ b/components/omnibox/browser/shortcuts_backend.cc diff --git a/build/patches/Keep-disabled-FetchLaterAPI.patch b/build/patches/Keep-disabled-FetchLaterAPI.patch index 370985d02..d71961a8b 100644 --- a/build/patches/Keep-disabled-FetchLaterAPI.patch +++ b/build/patches/Keep-disabled-FetchLaterAPI.patch @@ -12,11 +12,11 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html .../browser/loader/keep_alive_url_loader.cc | 33 +++++++++++++++++-- .../browser/loader/keep_alive_url_loader.h | 3 -- .../Keep-disabled-FetchLaterAPI.inc | 2 ++ - .../renderer/core/fetch/fetch_manager.cc | 14 ++++++-- + .../renderer/core/fetch/fetch_manager.cc | 21 ++++++++++-- .../loader/child_url_loader_factory_bundle.cc | 14 ++++---- .../platform/loader/fetch/resource_fetcher.cc | 2 +- .../platform/runtime_enabled_features.json5 | 5 ++- - 7 files changed, 55 insertions(+), 18 deletions(-) + 7 files changed, 62 insertions(+), 18 deletions(-) create mode 100644 cromite_flags/third_party/blink/common/features_cc/Keep-disabled-FetchLaterAPI.inc diff --git a/content/browser/loader/keep_alive_url_loader.cc b/content/browser/loader/keep_alive_url_loader.cc @@ -99,7 +99,28 @@ new file mode 100644 diff --git a/third_party/blink/renderer/core/fetch/fetch_manager.cc b/third_party/blink/renderer/core/fetch/fetch_manager.cc --- a/third_party/blink/renderer/core/fetch/fetch_manager.cc +++ b/third_party/blink/renderer/core/fetch/fetch_manager.cc -@@ -1283,10 +1283,18 @@ void FetchManager::Loader::Failed( +@@ -290,6 +290,7 @@ class ResponseResolver final : public GarbageCollected { + // Rejects the promise with the supplied object. + void Reject(v8::Local error); + void Reject(DOMException*); ++ void Detach(); + + // Rejects the promise with the TypeError exception created at construction + // time. Also passes the exception object to devtools if `devtools_request_id` +@@ -341,6 +342,12 @@ void ResponseResolver::Reject(DOMException* dom_exception) { + Clear(); + } + ++void ResponseResolver::Detach() { ++ CHECK(resolver_); ++ resolver_->Detach(); ++ Clear(); ++} ++ + void ResponseResolver::RejectBecauseFailed( + std::optional devtools_request_id, + std::optional issue_id) { +@@ -1283,10 +1290,18 @@ void FetchManager::Loader::Failed( if (response_resolver_) { ScriptState::Scope scope(GetScriptState()); if (dom_exception) { diff --git a/build/patches/Move-navigation-bar-to-bottom.patch b/build/patches/Move-navigation-bar-to-bottom.patch index ac7fc7202..5125a7984 100644 --- a/build/patches/Move-navigation-bar-to-bottom.patch +++ b/build/patches/Move-navigation-bar-to-bottom.patch @@ -1287,7 +1287,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/fullscreen/Brow + if (ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) + return 0; + else -+ return mTopControlContainerHeight; ++ return mTopControlsHeight; + } + @Override @@ -1647,7 +1647,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/Toolbar + ChromeFeatureList.sMoveTopToolbarToBottom.isEnabled()) { + // move up the container view of the ui + // below there is the toolbar -+ mBottomRoot.setTranslationY(-mBrowserControlsVisibilityManager.getTopControlsHeight()); ++ mBottomRoot.setTranslationY(-mBrowserControlsSizer.getTopControlsHeight()); + } + } + diff --git a/build/patches/Partition-Blink-memory-cache.patch b/build/patches/Partition-Blink-memory-cache.patch index a870db1c7..4fe49764d 100644 --- a/build/patches/Partition-Blink-memory-cache.patch +++ b/build/patches/Partition-Blink-memory-cache.patch @@ -17,13 +17,14 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../core/html/parser/html_srcset_parser.cc | 2 +- .../core/inspector/inspector_network_agent.cc | 2 +- .../core/inspector/inspector_page_agent.cc | 4 +- + .../core/loader/frame_fetch_context.cc | 2 + .../renderer/core/loader/image_loader.cc | 3 +- .../core/loader/worker_fetch_context.cc | 3 ++ .../platform/loader/fetch/memory_cache.cc | 8 +--- .../platform/loader/fetch/memory_cache.h | 5 +-- .../platform/loader/fetch/resource_fetcher.cc | 41 ++++++++++++++++--- .../platform/loader/fetch/resource_fetcher.h | 7 +++- - 9 files changed, 54 insertions(+), 21 deletions(-) + 10 files changed, 56 insertions(+), 21 deletions(-) diff --git a/third_party/blink/renderer/core/html/parser/html_srcset_parser.cc b/third_party/blink/renderer/core/html/parser/html_srcset_parser.cc --- a/third_party/blink/renderer/core/html/parser/html_srcset_parser.cc @@ -64,6 +65,18 @@ diff --git a/third_party/blink/renderer/core/inspector/inspector_page_agent.cc b } if (!cached_resource) cached_resource = loader->ResourceForURL(url); +diff --git a/third_party/blink/renderer/core/loader/frame_fetch_context.cc b/third_party/blink/renderer/core/loader/frame_fetch_context.cc +--- a/third_party/blink/renderer/core/loader/frame_fetch_context.cc ++++ b/third_party/blink/renderer/core/loader/frame_fetch_context.cc +@@ -852,6 +852,8 @@ void FrameFetchContext::PopulateResourceRequestBeforeCacheAccess( + if (document_loader_->ForceFetchCacheMode()) { + request.SetCacheMode(*document_loader_->ForceFetchCacheMode()); + } ++ if (!request.TopFrameOrigin()) ++ request.SetTopFrameOrigin(GetTopFrameOrigin()); + // ResourceFetcher::DidLoadResourceFromMemoryCache() may call out in such a + // way that the AttributionSupport is needed. + if (const AttributionSrcLoader* attribution_src_loader = diff --git a/third_party/blink/renderer/core/loader/image_loader.cc b/third_party/blink/renderer/core/loader/image_loader.cc --- a/third_party/blink/renderer/core/loader/image_loader.cc +++ b/third_party/blink/renderer/core/loader/image_loader.cc diff --git a/build/patches/Partition-HSTS-cache-by-NAK.patch b/build/patches/Partition-HSTS-cache-by-NAK.patch index 0d97ba48b..7f951dd6d 100644 --- a/build/patches/Partition-HSTS-cache-by-NAK.patch +++ b/build/patches/Partition-HSTS-cache-by-NAK.patch @@ -234,7 +234,7 @@ diff --git a/net/http/transport_security_state.cc b/net/http/transport_security_ } +std::vector CanonicalizeHost(const NetworkAnonymizationKey& nak, -+ const std::string& host) { ++ std::string_view host) { + std::vector hostname = CanonicalizeHostWithoutNak(host); + if (hostname.empty()) { + return hostname; @@ -245,7 +245,7 @@ diff --git a/net/http/transport_security_state.cc b/net/http/transport_security_ + return std::vector(); + + std::string lowered_host = base::ToLowerASCII( -+ nak.ToDebugString() + " " + host); ++ nak.ToDebugString() + " " + std::string(host)); + std::vector vector = + std::vector(lowered_host.begin(), lowered_host.end()); + if (vector.size() > 254) diff --git a/build/patches/Remove-binary-blob-integrations.patch b/build/patches/Remove-binary-blob-integrations.patch index aab4bfc1f..ccd2282fc 100644 --- a/build/patches/Remove-binary-blob-integrations.patch +++ b/build/patches/Remove-binary-blob-integrations.patch @@ -47,7 +47,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../browser/password_manager/android/BUILD.gn | 5 - .../password_manager/GmsUpdateLauncher.java | 28 - .../PasswordManagerAndroidBackendUtil.java | 38 +- - .../PasswordManagerHelper.java | 2 - + .../PasswordManagerHelper.java | 9 - ...swordSyncControllerDelegateBridgeImpl.java | 7 - .../push_messaging_service_factory.cc | 8 +- chrome/browser/resources/settings/route.ts | 2 - @@ -55,6 +55,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html chrome/browser/ui/android/omnibox/BUILD.gn | 4 - .../FullscreenSigninMediator.java | 12 +- chrome/browser/ui/webauthn/sheet_models.cc | 9 +- + .../browser/ui/webui/chrome_web_ui_configs.cc | 1 - chrome/browser/webauthn/android/BUILD.gn | 1 - .../CableAuthenticatorModuleProvider.java | 35 +- chrome/browser/webauthn/cablev2_devices.cc | 3 + @@ -90,9 +91,9 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html components/signin/public/android/BUILD.gn | 3 - .../signin/AccountRenameChecker.java | 16 - components/webauthn/android/BUILD.gn | 14 +- - .../webauthn/AuthenticatorImpl.java | 67 -- + .../webauthn/AuthenticatorImpl.java | 81 +- .../webauthn/ConditionalUiState.java | 15 + - .../components/webauthn/GmsCoreUtils.java | 21 +- + .../components/webauthn/GmsCoreUtils.java | 25 +- .../webauthn/WebauthnModeProvider.java | 15 - .../webauthn/cred_man/CredManHelper.java | 16 +- .../cred_man/CredManMetricsHelper.java | 2 +- @@ -108,7 +109,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../preconditions/javatests/BUILD.gn | 1 - .../gms/ChromiumPlayServicesAvailability.java | 10 +- third_party/cardboard/BUILD.gn | 4 - - 84 files changed, 115 insertions(+), 2295 deletions(-) + 85 files changed, 116 insertions(+), 2320 deletions(-) create mode 100644 components/webauthn/android/java/src/org/chromium/components/webauthn/ConditionalUiState.java diff --git a/android_webview/expectations/system_webview_bundle.AndroidManifest.expected b/android_webview/expectations/system_webview_bundle.AndroidManifest.expected @@ -1045,6 +1046,20 @@ diff --git a/chrome/browser/password_manager/android/java/src/org/chromium/chrom import org.jni_zero.JniType; import org.jni_zero.NativeMethods; +@@ -517,13 +515,6 @@ public class PasswordManagerHelper { + // If the exception is not a Chrome-defined one, it means that the call failed at the + // API call level. It could have either failed with a known ApiException or because of a + // different error (e.g. a different exception thrown by the implementation of the API). +- if (!(exception instanceof ApiException)) { +- RecordHistogram.recordEnumeratedHistogram( +- kGetIntentErrorHistogram, +- CredentialManagerError.OTHER_API_ERROR, +- CredentialManagerError.COUNT); +- return; +- } + + RecordHistogram.recordEnumeratedHistogram( + kGetIntentErrorHistogram, diff --git a/chrome/browser/password_manager/android/java/src/org/chromium/chrome/browser/password_manager/PasswordSyncControllerDelegateBridgeImpl.java b/chrome/browser/password_manager/android/java/src/org/chromium/chrome/browser/password_manager/PasswordSyncControllerDelegateBridgeImpl.java --- a/chrome/browser/password_manager/android/java/src/org/chromium/chrome/browser/password_manager/PasswordSyncControllerDelegateBridgeImpl.java +++ b/chrome/browser/password_manager/android/java/src/org/chromium/chrome/browser/password_manager/PasswordSyncControllerDelegateBridgeImpl.java @@ -1190,6 +1205,17 @@ diff --git a/chrome/browser/ui/webauthn/sheet_models.cc b/chrome/browser/ui/weba } void AuthenticatorMultiSourcePickerSheetModel::OnManageDevices() { +diff --git a/chrome/browser/ui/webui/chrome_web_ui_configs.cc b/chrome/browser/ui/webui/chrome_web_ui_configs.cc +--- a/chrome/browser/ui/webui/chrome_web_ui_configs.cc ++++ b/chrome/browser/ui/webui/chrome_web_ui_configs.cc +@@ -220,7 +220,6 @@ void RegisterChromeWebUIConfigs() { + map.AddWebUIConfig(std::make_unique()); + map.AddWebUIConfig(std::make_unique()); + map.AddWebUIConfig(std::make_unique()); +- map.AddWebUIConfig(std::make_unique()); + map.AddWebUIConfig(std::make_unique()); + map.AddWebUIConfig(std::make_unique()); + map.AddWebUIConfig(std::make_unique()); diff --git a/chrome/browser/webauthn/android/BUILD.gn b/chrome/browser/webauthn/android/BUILD.gn --- a/chrome/browser/webauthn/android/BUILD.gn +++ b/chrome/browser/webauthn/android/BUILD.gn @@ -3297,7 +3323,28 @@ diff --git a/components/webauthn/android/java/src/org/chromium/components/webaut } @Override -@@ -327,14 +281,6 @@ public final class AuthenticatorImpl implements Authenticator, AuthenticationCon +@@ -285,19 +239,7 @@ public final class AuthenticatorImpl implements Authenticator, AuthenticationCon + return; + } + +- getFido2CredentialRequest() +- .handleIsUserVerifyingPlatformAuthenticatorAvailableRequest( +- isUvpaa -> { +- capabilities.add( +- createWebAuthnClientCapability( +- AuthenticatorConstants.CAPABILITY_CONDITIONAL_GET, +- couldSupportConditionalMediation() && isUvpaa)); +- capabilities.add( +- createWebAuthnClientCapability( +- AuthenticatorConstants.CAPABILITY_UVPAA, +- couldSupportUvpaa() && isUvpaa)); +- callback.call(capabilities.toArray(new WebAuthnClientCapability[0])); +- }); ++ callback.call(capabilities.toArray(new WebAuthnClientCapability[0])); + } + + // Helper function to create WebAuthnClientCapability instances +@@ -327,14 +269,6 @@ public final class AuthenticatorImpl implements Authenticator, AuthenticationCon callback.onResponse(new ArrayList()); return; } @@ -3312,7 +3359,7 @@ diff --git a/components/webauthn/android/java/src/org/chromium/components/webaut } @Override -@@ -344,13 +290,6 @@ public final class AuthenticatorImpl implements Authenticator, AuthenticationCon +@@ -344,13 +278,6 @@ public final class AuthenticatorImpl implements Authenticator, AuthenticationCon callback.call(false); return; } @@ -3326,7 +3373,7 @@ diff --git a/components/webauthn/android/java/src/org/chromium/components/webaut } @Override -@@ -362,8 +301,6 @@ public final class AuthenticatorImpl implements Authenticator, AuthenticationCon +@@ -362,8 +289,6 @@ public final class AuthenticatorImpl implements Authenticator, AuthenticationCon if (!mIsOperationPending || mGetAssertionCallback == null) { return; } @@ -3335,7 +3382,7 @@ diff --git a/components/webauthn/android/java/src/org/chromium/components/webaut } /** Callbacks for receiving responses from the internal handlers. */ -@@ -398,7 +335,6 @@ public final class AuthenticatorImpl implements Authenticator, AuthenticationCon +@@ -398,7 +323,6 @@ public final class AuthenticatorImpl implements Authenticator, AuthenticationCon } else if (mGetAssertionCallback != null) { mGetAssertionCallback.call(status, null, null); } @@ -3343,7 +3390,7 @@ diff --git a/components/webauthn/android/java/src/org/chromium/components/webaut cleanupRequest(); } -@@ -439,13 +375,10 @@ public final class AuthenticatorImpl implements Authenticator, AuthenticationCon +@@ -439,13 +363,10 @@ public final class AuthenticatorImpl implements Authenticator, AuthenticationCon mIsOperationPending = false; mMakeCredentialCallback = null; mGetAssertionCallback = null; @@ -3407,7 +3454,7 @@ diff --git a/components/webauthn/android/java/src/org/chromium/components/webaut } /** -@@ -33,17 +22,17 @@ public class GmsCoreUtils { +@@ -33,20 +22,16 @@ public class GmsCoreUtils { * version. */ public static boolean isGetMatchingCredentialIdsSupported() { @@ -3424,10 +3471,13 @@ diff --git a/components/webauthn/android/java/src/org/chromium/components/webaut /** Returns whether makeCredential / getAssertion APIs support responding via ResultReceiver. */ static boolean isResultReceiverSupported() { - return getGmsCoreVersion() >= GMSCORE_MIN_VERSION_RESULT_RECEIVER; +- } +- +- public static void setGmsCoreVersionForTesting(int version) { +- sGmsCorePackageVersion = version; + return false; } - - public static void setGmsCoreVersionForTesting(int version) { + } diff --git a/components/webauthn/android/java/src/org/chromium/components/webauthn/WebauthnModeProvider.java b/components/webauthn/android/java/src/org/chromium/components/webauthn/WebauthnModeProvider.java --- a/components/webauthn/android/java/src/org/chromium/components/webauthn/WebauthnModeProvider.java +++ b/components/webauthn/android/java/src/org/chromium/components/webauthn/WebauthnModeProvider.java diff --git a/build/patches/Revert-flags-remove-num-raster-threads.patch b/build/patches/Revert-flags-remove-num-raster-threads.patch index d5e8998b6..9b68bf025 100644 --- a/build/patches/Revert-flags-remove-num-raster-threads.patch +++ b/build/patches/Revert-flags-remove-num-raster-threads.patch @@ -21,10 +21,10 @@ new file mode 100644 + +const FeatureEntry::Choice kNumRasterThreadsChoices[] = { + {flags_ui::kGenericExperimentChoiceDefault, "", ""}, -+ {"1", cc::switches::kNumRasterThreads, "1"}, -+ {"2", cc::switches::kNumRasterThreads, "2"}, -+ {"3", cc::switches::kNumRasterThreads, "3"}, -+ {"4", cc::switches::kNumRasterThreads, "4"}}; ++ {"1", switches::kNumRasterThreads, "1"}, ++ {"2", switches::kNumRasterThreads, "2"}, ++ {"3", switches::kNumRasterThreads, "3"}, ++ {"4", switches::kNumRasterThreads, "4"}}; + +#endif + diff --git a/build/patches/Revert-remove-allowscript-content-setting-secondary-url.patch b/build/patches/Revert-remove-allowscript-content-setting-secondary-url.patch index 3b92e65f0..773ad6476 100644 --- a/build/patches/Revert-remove-allowscript-content-setting-secondary-url.patch +++ b/build/patches/Revert-remove-allowscript-content-setting-secondary-url.patch @@ -298,7 +298,7 @@ diff --git a/third_party/blink/renderer/core/loader/frame_fetch_context.cc b/thi return; } -@@ -911,15 +912,26 @@ void FrameFetchContext::SetFirstPartyCookie(ResourceRequest& request) { +@@ -913,15 +914,26 @@ void FrameFetchContext::SetFirstPartyCookie(ResourceRequest& request) { request.SetSiteForCookies(GetSiteForCookies()); } diff --git a/build/patches/Show-NTP-at-startup.patch b/build/patches/Show-NTP-at-startup.patch index f765a9f88..487490ff9 100644 --- a/build/patches/Show-NTP-at-startup.patch +++ b/build/patches/Show-NTP-at-startup.patch @@ -181,7 +181,7 @@ new file mode 100644 + +package org.chromium.chrome.browser.flags.cromite; + -+import org.chromium.base.cached_flags.CachedFlag; ++import org.chromium.components.cached_flags.CachedFlag; +import org.chromium.chrome.browser.flags.ChromeFeatureMap; + +public class sShowNtpAtStartupAndroid { diff --git a/build/patches/Temp-PerformanceNavigationTiming-privacy-fix.patch b/build/patches/Temp-PerformanceNavigationTiming-privacy-fix.patch index dc4bef0b8..bfe8f0968 100644 --- a/build/patches/Temp-PerformanceNavigationTiming-privacy-fix.patch +++ b/build/patches/Temp-PerformanceNavigationTiming-privacy-fix.patch @@ -15,7 +15,7 @@ diff --git a/third_party/blink/renderer/core/timing/performance_navigation_timin namespace { V8NavigationEntropy::Enum GetSystemEntropy(DocumentLoader* loader) { -+ if ((true)) return "high"; ++ if ((true)) return V8NavigationEntropy::Enum::kHigh; if (loader) { switch (loader->GetTiming().SystemEntropyAtNavigationStart()) { case mojom::blink::SystemEntropy::kHigh: diff --git a/build/patches/Temp-guard-FileSystemAccessPersistentPermissions.patch b/build/patches/Temp-guard-FileSystemAccessPersistentPermissions.patch index ce96fbc0f..dd48a3cfc 100644 --- a/build/patches/Temp-guard-FileSystemAccessPersistentPermissions.patch +++ b/build/patches/Temp-guard-FileSystemAccessPersistentPermissions.patch @@ -4,8 +4,8 @@ Subject: Temp guard FileSystemAccessPersistentPermissions --- .../chrome_file_system_access_permission_context.cc | 4 ++-- - .../browser/file_system_access/file_system_access_features.cc | 4 ++++ - 2 files changed, 6 insertions(+), 2 deletions(-) + .../browser/file_system_access/file_system_access_features.cc | 1 + + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc b/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc --- a/chrome/browser/file_system_access/chrome_file_system_access_permission_context.cc @@ -31,13 +31,10 @@ diff --git a/chrome/browser/file_system_access/chrome_file_system_access_permiss diff --git a/chrome/browser/file_system_access/file_system_access_features.cc b/chrome/browser/file_system_access/file_system_access_features.cc --- a/chrome/browser/file_system_access/file_system_access_features.cc +++ b/chrome/browser/file_system_access/file_system_access_features.cc -@@ -23,4 +23,8 @@ BASE_FEATURE(kFileSystemAccessSymbolicLinkCheck, +@@ -23,4 +23,5 @@ BASE_FEATURE(kFileSystemAccessSymbolicLinkCheck, "FileSystemAccessSymbolicLinkCheck", base::FEATURE_ENABLED_BY_DEFAULT); -+#if BUILDFLAG(IS_WIN) -+SET_CROMITE_FEATURE_ENABLED(kFileSystemAccessLocalUNCPathBlock); -+#endif +SET_CROMITE_FEATURE_DISABLED(kFileSystemAccessPersistentPermissions); } // namespace features -- diff --git a/build/patches/Use-browser-navigation-handler.patch b/build/patches/Use-browser-navigation-handler.patch index 5fddae01e..231a08c00 100644 --- a/build/patches/Use-browser-navigation-handler.patch +++ b/build/patches/Use-browser-navigation-handler.patch @@ -12,7 +12,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html .../GestureNavigationViewBinder.java | 6 ++-- .../HistoryNavigationCoordinator.java | 4 +++ .../gesturenav/HistoryNavigationLayout.java | 6 ++-- - .../browser/gesturenav/NavigationHandler.java | 11 +++++-- + .../browser/gesturenav/NavigationHandler.java | 12 +++++-- .../browser/gesturenav/SideSlideLayout.java | 25 +++++++++++--- .../tabbed_mode/TabbedRootUiCoordinator.java | 3 ++ .../cromite/sUseBrowserNavigationHandler.java | 33 +++++++++++++++++++ @@ -22,7 +22,7 @@ License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html .../Use-browser-navigation-handler.inc | 12 +++++++ .../Use-browser-navigation-handler.inc | 3 ++ .../Use-browser-navigation-handler.inc | 1 + - 15 files changed, 135 insertions(+), 15 deletions(-) + 15 files changed, 135 insertions(+), 16 deletions(-) create mode 100644 chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/cromite/sUseBrowserNavigationHandler.java create mode 100644 chrome/browser/ui/android/strings/cromite_android_chrome_strings_grd/Use-browser-navigation-handler.grdp create mode 100644 cromite_flags/chrome/browser/about_flags_cc/Use-browser-navigation-handler.inc @@ -139,11 +139,12 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/gesturenav/Navi import static org.chromium.chrome.browser.gesturenav.GestureNavigationProperties.EDGE; import android.app.Activity; -@@ -277,6 +277,11 @@ class NavigationHandler implements TouchEventObserver { +@@ -276,7 +276,11 @@ class NavigationHandler implements TouchEventObserver { + boolean forward = isForward(); - mModel.set(DIRECTION, forward); -+ if (mInitiatingEdge == edge && canNavigate(true)) { +- mModel.set(DIRECTION, forward); ++ if (mInitiatingEdge == BackGestureEventSwipeEdge.RIGHT && canNavigate(true)) { + mModel.set(CANFORWARD, true); + } else { + mModel.set(CANFORWARD, false); @@ -151,7 +152,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/gesturenav/Navi mModel.set(EDGE, mInitiatingEdge); if (canNavigate(forward)) { if (mState != GestureState.STARTED) mModel.set(ACTION, GestureAction.RESET_BUBBLE); -@@ -483,12 +488,14 @@ class NavigationHandler implements TouchEventObserver { +@@ -483,12 +487,14 @@ class NavigationHandler implements TouchEventObserver { } private boolean isForward() { @@ -267,7 +268,7 @@ new file mode 100644 + +package org.chromium.chrome.browser.flags.cromite; + -+import org.chromium.base.cached_flags.CachedFlag; ++import org.chromium.components.cached_flags.CachedFlag; +import org.chromium.chrome.browser.flags.ChromeFeatureMap; + +public class sUseBrowserNavigationHandler { diff --git a/build/patches/Use-list-mode-for-tab-switcher.patch b/build/patches/Use-list-mode-for-tab-switcher.patch index 8c8b7433a..0c056a328 100644 --- a/build/patches/Use-list-mode-for-tab-switcher.patch +++ b/build/patches/Use-list-mode-for-tab-switcher.patch @@ -79,7 +79,7 @@ new file mode 100644 + +package org.chromium.chrome.browser.flags.cromite; + -+import org.chromium.base.cached_flags.CachedFlag; ++import org.chromium.components.cached_flags.CachedFlag; +import org.chromium.chrome.browser.flags.ChromeFeatureMap; + +public class sTabSwitcherListMode { diff --git a/build/patches/bromite-build-utils.patch b/build/patches/bromite-build-utils.patch index bf2d46b60..cd33a72d6 100644 --- a/build/patches/bromite-build-utils.patch +++ b/build/patches/bromite-build-utils.patch @@ -594,9 +594,9 @@ new file mode 100755 @@ -0,0 +1,46 @@ +package org.chromium.chrome.browser.flags; + -+import org.chromium.base.cached_flags.CachedFlag; -+import org.chromium.chrome.browser.flags.ChromeFeatureList; +import org.chromium.base.cached_flags.CachedFlagsSharedPreferences; ++import org.chromium.components.cached_flags.CachedFlag; ++import org.chromium.chrome.browser.flags.ChromeFeatureList; + +import org.jni_zero.CalledByNative; +import org.jni_zero.NativeMethods; diff --git a/build/patches/eyeo-beta-118.0.5993.48-android_api.patch b/build/patches/eyeo-beta-118.0.5993.48-android_api.patch index db8881c6d..ac73fab3f 100644 --- a/build/patches/eyeo-beta-118.0.5993.48-android_api.patch +++ b/build/patches/eyeo-beta-118.0.5993.48-android_api.patch @@ -215,7 +215,7 @@ new file mode 100644 + +content::BrowserContext* AdblockJNIFactory::GetBrowserContextToUse( + content::BrowserContext* context) const { -+ return chrome::GetBrowserContextRedirectedInIncognito(context); ++ return GetBrowserContextRedirectedInIncognito(context); +} + +bool AdblockJNIFactory::ServiceIsCreatedWithBrowserContext() const { @@ -349,7 +349,7 @@ new file mode 100644 +content::BrowserContext* +FilteringConfigurationBindingsFactory::GetBrowserContextToUse( + content::BrowserContext* context) const { -+ return chrome::GetBrowserContextRedirectedInIncognito(context); ++ return GetBrowserContextRedirectedInIncognito(context); +} + +bool FilteringConfigurationBindingsFactory::ServiceIsCreatedWithBrowserContext() @@ -574,7 +574,7 @@ new file mode 100644 +content::BrowserContext* +ResourceClassificationNotifierBindingsFactory::GetBrowserContextToUse( + content::BrowserContext* context) const { -+ return chrome::GetBrowserContextRedirectedInIncognito(context); ++ return GetBrowserContextRedirectedInIncognito(context); +} + +bool ResourceClassificationNotifierBindingsFactory:: diff --git a/build/patches/eyeo-beta-118.0.5993.48-base.patch b/build/patches/eyeo-beta-118.0.5993.48-base.patch index 7285d112d..fa101de29 100644 --- a/build/patches/eyeo-beta-118.0.5993.48-base.patch +++ b/build/patches/eyeo-beta-118.0.5993.48-base.patch @@ -222,8 +222,8 @@ Based on Chromium 118.0.5993.48 tools/eyeo/generate_interdiffs.sh | 150 ++ tools/eyeo/generate_modules.sh | 209 +++ tools/eyeo/snippets_deps.py | 61 + - tools/gritsettings/resource_ids.spec | 9 + - 219 files changed, 22050 insertions(+), 3 deletions(-) + tools/gritsettings/resource_ids.spec | 11 +- + 219 files changed, 22051 insertions(+), 4 deletions(-) create mode 100644 components/adblock/CHANGELOG.md create mode 100644 components/adblock/LICENSE create mode 100644 components/adblock/README.md @@ -53109,16 +53109,18 @@ diff --git a/tools/gritsettings/resource_ids.spec b/tools/gritsettings/resource_ # This file is used to assign starting resource ids for resources and strings # used by Chromium. This is done to ensure that resource ids are unique # across all the grd files. If you are adding a new grd file, please add -@@ -1384,6 +1388,11 @@ +@@ -1382,7 +1386,12 @@ + "<(SHARED_INTERMEDIATE_DIR)/third_party/blink/public/strings/permission_element_generated_strings.grd": { + "META": {"sizes": {"messages": [2000],}}, "messages": [10080], - } - +- } ++ }, ++ + "<(SHARED_INTERMEDIATE_DIR)/chrome/browser/resources/adblock_internals/resources.grd": { + "META": {"sizes": {"includes": [10]}}, + "includes": [10100], + }, -+ + # END "everything else" section. # Everything but chrome/, components/, content/, and ios/ - -- diff --git a/build/patches/eyeo-beta-118.0.5993.48-chrome_integration.patch b/build/patches/eyeo-beta-118.0.5993.48-chrome_integration.patch index b02796467..c90551cc9 100644 --- a/build/patches/eyeo-beta-118.0.5993.48-chrome_integration.patch +++ b/build/patches/eyeo-beta-118.0.5993.48-chrome_integration.patch @@ -50,11 +50,11 @@ Pre-requisites: eyeo Browser Ad filtering Solution: Base Module .../adblock_internals_page_handler_impl.h | 51 +++ .../adblock_internals/adblock_internals_ui.cc | 47 +++ .../adblock_internals/adblock_internals_ui.h | 48 +++ - .../webui/chrome_web_ui_controller_factory.cc | 9 +- + .../webui/chrome_web_ui_controller_factory.cc | 8 + chrome/common/BUILD.gn | 3 + chrome/common/webui_url_constants.cc | 4 + chrome/common/webui_url_constants.h | 5 + - 48 files changed, 2288 insertions(+), 3 deletions(-) + 48 files changed, 2288 insertions(+), 2 deletions(-) create mode 100644 chrome/browser/adblock/README.md create mode 100644 chrome/browser/adblock/adblock_content_browser_client.cc create mode 100644 chrome/browser/adblock/adblock_content_browser_client.h @@ -883,7 +883,7 @@ new file mode 100644 + +content::BrowserContext* AdblockControllerFactory::GetBrowserContextToUse( + content::BrowserContext* context) const { -+ return chrome::GetBrowserContextRedirectedInIncognito(context); ++ return GetBrowserContextRedirectedInIncognito(context); +} + +} // namespace adblock @@ -1005,7 +1005,7 @@ new file mode 100644 + +content::BrowserContext* AdblockTelemetryServiceFactory::GetBrowserContextToUse( + content::BrowserContext* context) const { -+ return chrome::GetBrowserContextRedirectedInIncognito(context); ++ return GetBrowserContextRedirectedInIncognito(context); +} + +} // namespace adblock @@ -1208,7 +1208,7 @@ new file mode 100644 +content::BrowserContext* +ContentSecurityPolicyInjectorFactory::GetBrowserContextToUse( + content::BrowserContext* context) const { -+ return chrome::GetBrowserContextRedirectedInIncognito(context); ++ return GetBrowserContextRedirectedInIncognito(context); +} + +} // namespace adblock @@ -1330,7 +1330,7 @@ new file mode 100644 + +content::BrowserContext* ElementHiderFactory::GetBrowserContextToUse( + content::BrowserContext* context) const { -+ return chrome::GetBrowserContextRedirectedInIncognito(context); ++ return GetBrowserContextRedirectedInIncognito(context); +} + +} // namespace adblock @@ -1458,7 +1458,7 @@ new file mode 100644 +content::BrowserContext* +ResourceClassificationRunnerFactory::GetBrowserContextToUse( + content::BrowserContext* context) const { -+ return chrome::GetBrowserContextRedirectedInIncognito(context); ++ return GetBrowserContextRedirectedInIncognito(context); +} + +} // namespace adblock @@ -1581,7 +1581,7 @@ new file mode 100644 + +content::BrowserContext* SessionStatsFactory::GetBrowserContextToUse( + content::BrowserContext* context) const { -+ return chrome::GetBrowserContextRedirectedInIncognito(context); ++ return GetBrowserContextRedirectedInIncognito(context); +} + +} // namespace adblock @@ -1697,7 +1697,7 @@ new file mode 100644 + +content::BrowserContext* SitekeyStorageFactory::GetBrowserContextToUse( + content::BrowserContext* context) const { -+ return chrome::GetBrowserContextRedirectedInIncognito(context); ++ return GetBrowserContextRedirectedInIncognito(context); +} + +} // namespace adblock @@ -1817,7 +1817,7 @@ new file mode 100644 +content::BrowserContext* +SubscriptionPersistentMetadataFactory::GetBrowserContextToUse( + content::BrowserContext* context) const { -+ return chrome::GetBrowserContextRedirectedInIncognito(context); ++ return GetBrowserContextRedirectedInIncognito(context); +} + +} // namespace adblock @@ -1942,7 +1942,7 @@ new file mode 100644 + +content::BrowserContext* SubscriptionServiceFactory::GetBrowserContextToUse( + content::BrowserContext* context) const { -+ return chrome::GetBrowserContextRedirectedInIncognito(context); ++ return GetBrowserContextRedirectedInIncognito(context); +} + +} // namespace adblock @@ -2830,11 +2830,10 @@ diff --git a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc b/chrom #include "chrome/browser/ui/webui/components/components_ui.h" #include "chrome/browser/ui/webui/crashes_ui.h" #include "chrome/browser/ui/webui/proxy_config_ui.h" -@@ -269,7 +274,9 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui, - if (url.host_piece() == user_scripts::kChromeUIUserScriptsHost) - return &NewWebUI; - #endif -- +@@ -276,6 +281,9 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui, + if (url.host_piece() == chrome::kChromeUISettingsHost) + return &NewWebUI; + #endif // BUILDFLAG(IS_ANDROID) + if (url.host_piece() == chrome::kChromeUIAdblockInternalsHost) { + return &NewWebUI; + } diff --git a/build/patches/ungoogled-chromium-no-special-hosts-domains.patch b/build/patches/ungoogled-chromium-no-special-hosts-domains.patch index 89e3971ac..9481fb247 100644 --- a/build/patches/ungoogled-chromium-no-special-hosts-domains.patch +++ b/build/patches/ungoogled-chromium-no-special-hosts-domains.patch @@ -33,7 +33,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html chrome/browser/safe_browsing/BUILD.gn | 1 - chrome/browser/search_engines/BUILD.gn | 1 - .../ui_thread_search_terms_data.cc | 4 - - .../signin/android/signin_manager_android.cc | 1 + + .../signin/android/signin_manager_android.cc | 5 +- chrome/browser/ui/BUILD.gn | 1 - chrome/browser/ui/android/omnibox/BUILD.gn | 2 - .../omnibox/LocationBarCoordinator.java | 2 - @@ -65,7 +65,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html ...gled-chromium-no-special-hosts-domains.inc | 1 + net/base/url_util.cc | 25 +- services/network/network_context.cc | 2 +- - 58 files changed, 53 insertions(+), 819 deletions(-) + 58 files changed, 53 insertions(+), 823 deletions(-) create mode 100644 cromite_flags/content/public/common/content_features_cc/ungoogled-chromium-no-special-hosts-domains.inc diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java @@ -722,6 +722,17 @@ diff --git a/chrome/browser/signin/android/signin_manager_android.cc b/chrome/br if (all_data) { chrome_browsing_data_remover::DataType removed_types = chrome_browsing_data_remover::ALL_DATA_TYPES; +@@ -94,10 +95,6 @@ class ProfileDataRemover : public content::BrowsingDataRemover::Observer { + + // TODO(msramek): BrowsingDataFilterBuilder was not designed for + // large filters. Optimize it. +- for (const std::string& domain : +- google_util::GetGoogleRegistrableDomains()) { +- google_tld_filter->AddRegisterableDomain(domain); +- } + + remover_->RemoveWithFilterAndReply( + base::Time(), base::Time::Max(), diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn --- a/chrome/browser/ui/BUILD.gn +++ b/chrome/browser/ui/BUILD.gn