From 6e1f9211421e06bccba17c79f21df17862fb1d29 Mon Sep 17 00:00:00 2001 From: Carmelo Messina Date: Sun, 8 Oct 2023 19:11:46 +0200 Subject: [PATCH] v118 patches --- .../00Add-option-to-disable-snapshots.patch | 38 ++- ...Add-lifetime-options-for-permissions.patch | 263 +++++++++++++++--- .../Content-settings-infrastructure.patch | 17 +- .../patches/Disable-all-predictors-code.patch | 104 ++++++- .../Multiple-fingerprinting-mitigations.patch | 2 +- .../Remove-binary-blob-integrations.patch | 14 +- build/patches/User-agent-customization.patch | 9 +- .../eyeo-117.0.5938.0-android_api.patch | 7 +- 8 files changed, 378 insertions(+), 76 deletions(-) diff --git a/build/patches/00Add-option-to-disable-snapshots.patch b/build/patches/00Add-option-to-disable-snapshots.patch index e4e46981..3e418d7f 100644 --- a/build/patches/00Add-option-to-disable-snapshots.patch +++ b/build/patches/00Add-option-to-disable-snapshots.patch @@ -4,13 +4,14 @@ Subject: Add option to disable snapshots License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html --- - .../tab_management/TabGridViewBinder.java | 8 +++- + .../tab_management/TabGridViewBinder.java | 9 +++- + .../tasks/tab_management/TabProperties.java | 5 +++ .../java/res/xml/privacy_preferences.xml | 5 +++ .../chrome/browser/app/ChromeActivity.java | 3 +- .../layouts/content/TabContentManager.java | 7 +++- .../privacy/settings/PrivacySettings.java | 42 ++++++++++++++++++- .../strings/android_chrome_strings.grd | 8 ++++ - 6 files changed, 67 insertions(+), 6 deletions(-) + 7 files changed, 73 insertions(+), 6 deletions(-) diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGridViewBinder.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGridViewBinder.java --- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabGridViewBinder.java @@ -30,6 +31,39 @@ diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser } }; if (sThumbnailFetcherForTesting != null) { +@@ -370,6 +374,7 @@ class TabGridViewBinder { + */ + private static void setFavicon(ViewLookupCachingFrameLayout rootView, PropertyModel model, + TabListFaviconProvider.TabFavicon favicon) { ++ model.set(TabProperties.FAVICON, favicon); + ImageView faviconView = (ImageView) rootView.fastFindViewById(R.id.tab_favicon); + if (favicon == null) { + faviconView.setImageDrawable(null); +diff --git a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabProperties.java b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabProperties.java +--- a/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabProperties.java ++++ b/chrome/android/features/tab_ui/java/src/org/chromium/chrome/browser/tasks/tab_management/TabProperties.java +@@ -56,6 +56,9 @@ public class TabProperties { + public static final WritableBooleanPropertyKey FAVICON_FETCHED = + new WritableBooleanPropertyKey(); + ++ public static final WritableObjectPropertyKey FAVICON = ++ new WritableObjectPropertyKey<>(); ++ + /** + * Property for lazily fetching favicons when required by an item in a UI. + */ +@@ -134,9 +137,11 @@ public class TabProperties { + SELECTABLE_TAB_ACTION_BUTTON_BACKGROUND, + SELECTABLE_TAB_ACTION_BUTTON_SELECTED_BACKGROUND, URL_DOMAIN, ACCESSIBILITY_DELEGATE, + CARD_TYPE, CONTENT_DESCRIPTION_STRING, CLOSE_BUTTON_DESCRIPTION_STRING, ++ FAVICON, + SHOPPING_PERSISTED_TAB_DATA_FETCHER, SHOULD_SHOW_PRICE_DROP_TOOLTIP}; + + public static final PropertyKey[] ALL_KEYS_TAB_STRIP = new PropertyKey[] {TAB_ID, + TAB_SELECTED_LISTENER, TAB_CLOSED_LISTENER, FAVICON_FETCHED, FAVICON_FETCHER, ++ FAVICON, + IS_SELECTED, TITLE, TABSTRIP_FAVICON_BACKGROUND_COLOR_ID, IS_INCOGNITO}; + } diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml --- a/chrome/android/java/res/xml/privacy_preferences.xml +++ b/chrome/android/java/res/xml/privacy_preferences.xml diff --git a/build/patches/Add-lifetime-options-for-permissions.patch b/build/patches/Add-lifetime-options-for-permissions.patch index 56a9dd0b..e68bb333 100644 --- a/build/patches/Add-lifetime-options-for-permissions.patch +++ b/build/patches/Add-lifetime-options-for-permissions.patch @@ -57,6 +57,9 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../one_time_permissions_tracker.h | 5 +- .../one_time_permissions_tracker_factory.cc | 2 +- .../permission_prompt_bubble_base_view.cc | 2 +- + .../browser/content_autofill_driver.cc | 64 ++++++++------- + .../content/browser/content_autofill_driver.h | 2 +- + .../autofill/core/browser/autofill_driver.h | 2 + .../site_settings/PermissionInfo.java | 14 +++- .../site_settings/SingleWebsiteSettings.java | 10 +++ .../WebsitePreferenceBridge.java | 6 +- @@ -80,14 +83,14 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../android/permissions_android_strings.grd | 17 ++++ .../geolocation_permission_context_android.cc | 35 ++++++-- .../geolocation_permission_context_android.h | 14 +++- - .../permissions/permission_context_base.cc | 54 +++++++++++-- - .../permissions/permission_context_base.h | 25 +++++- + .../permissions/permission_context_base.cc | 51 ++++++++++-- + .../permissions/permission_context_base.h | 23 +++++- components/permissions/permission_prompt.h | 3 +- - components/permissions/permission_request.cc | 34 +++++++- - components/permissions/permission_request.h | 18 ++++- + components/permissions/permission_request.cc | 30 ++++++- + components/permissions/permission_request.h | 16 +++- .../permissions/permission_request_manager.cc | 45 +++++++---- .../permissions/permission_request_manager.h | 11 ++- - 35 files changed, 520 insertions(+), 60 deletions(-) + 38 files changed, 546 insertions(+), 91 deletions(-) diff --git a/chrome/browser/permissions/last_tab_standing_tracker.cc b/chrome/browser/permissions/last_tab_standing_tracker.cc --- a/chrome/browser/permissions/last_tab_standing_tracker.cc @@ -238,6 +241,207 @@ diff --git a/chrome/browser/ui/views/permissions/permission_prompt_bubble_base_v return; case PermissionDialogButton::kDeny: RecordDecision(permissions::PermissionAction::DENIED); +diff --git a/components/autofill/content/browser/content_autofill_driver.cc b/components/autofill/content/browser/content_autofill_driver.cc +--- a/components/autofill/content/browser/content_autofill_driver.cc ++++ b/components/autofill/content/browser/content_autofill_driver.cc +@@ -426,8 +426,8 @@ void ContentAutofillDriver::FormsSeen( + const std::vector& removed_forms) { + target->GetAutofillManager().OnFormsSeen( + WithNewVersion(updated_forms), removed_forms); +- if (target->secondary_autofill_manager_) { +- target->secondary_autofill_manager_->OnFormsSeen( ++ if (target->secondary_autofill_manager()) { ++ target->secondary_autofill_manager()->OnFormsSeen( + WithNewVersion(updated_forms), removed_forms); + } + }); +@@ -457,8 +457,8 @@ void ContentAutofillDriver::FormSubmitted( + } + target->GetAutofillManager().OnFormSubmitted( + WithNewVersion(form), known_success, submission_source); +- if (target->secondary_autofill_manager_) { +- target->secondary_autofill_manager_->OnFormSubmitted( ++ if (target->secondary_autofill_manager()) { ++ target->secondary_autofill_manager()->OnFormSubmitted( + WithNewVersion(form), known_success, submission_source); + } + }); +@@ -482,8 +482,8 @@ void ContentAutofillDriver::TextFieldDidChange(const FormData& raw_form, + base::TimeTicks timestamp) { + target->GetAutofillManager().OnTextFieldDidChange( + WithNewVersion(form), field, bounding_box, timestamp); +- if (target->secondary_autofill_manager_) { +- target->secondary_autofill_manager_->OnTextFieldDidChange( ++ if (target->secondary_autofill_manager()) { ++ target->secondary_autofill_manager()->OnTextFieldDidChange( + WithNewVersion(form), field, bounding_box, timestamp); + } + }); +@@ -505,8 +505,8 @@ void ContentAutofillDriver::TextFieldDidScroll(const FormData& raw_form, + const FormFieldData& field, const gfx::RectF& bounding_box) { + target->GetAutofillManager().OnTextFieldDidScroll(WithNewVersion(form), + field, bounding_box); +- if (target->secondary_autofill_manager_) { +- target->secondary_autofill_manager_->OnTextFieldDidScroll( ++ if (target->secondary_autofill_manager()) { ++ target->secondary_autofill_manager()->OnTextFieldDidScroll( + WithNewVersion(form), field, bounding_box); + } + }); +@@ -529,8 +529,8 @@ void ContentAutofillDriver::SelectControlDidChange( + const FormFieldData& field, const gfx::RectF& bounding_box) { + target->GetAutofillManager().OnSelectControlDidChange( + WithNewVersion(form), field, bounding_box); +- if (target->secondary_autofill_manager_) { +- target->secondary_autofill_manager_->OnSelectControlDidChange( ++ if (target->secondary_autofill_manager()) { ++ target->secondary_autofill_manager()->OnSelectControlDidChange( + WithNewVersion(form), field, bounding_box); + } + }); +@@ -555,8 +555,8 @@ void ContentAutofillDriver::AskForValuesToFill( + AutofillSuggestionTriggerSource trigger_source) { + target->GetAutofillManager().OnAskForValuesToFill( + WithNewVersion(form), field, bounding_box, trigger_source); +- if (target->secondary_autofill_manager_) { +- target->secondary_autofill_manager_->OnAskForValuesToFill( ++ if (target->secondary_autofill_manager()) { ++ target->secondary_autofill_manager()->OnAskForValuesToFill( + WithNewVersion(form), field, bounding_box, trigger_source); + } + }); +@@ -570,8 +570,8 @@ void ContentAutofillDriver::HidePopup() { + DCHECK(!target->IsPrerendering()) + << "We should never affect UI while prerendering"; + target->GetAutofillManager().OnHidePopup(); +- if (target->secondary_autofill_manager_) +- target->secondary_autofill_manager_->OnHidePopup(); ++ if (target->secondary_autofill_manager()) ++ target->secondary_autofill_manager()->OnHidePopup(); + }); + } + +@@ -583,8 +583,8 @@ void ContentAutofillDriver::FocusNoLongerOnForm(bool had_interacted_form) { + this, had_interacted_form, + [](autofill::AutofillDriver* target, bool had_interacted_form) { + target->GetAutofillManager().OnFocusNoLongerOnForm(had_interacted_form); +- if (target->secondary_autofill_manager_) +- target->secondary_autofill_manager_->OnFocusNoLongerOnForm(had_interacted_form); ++ if (target->secondary_autofill_manager()) ++ target->secondary_autofill_manager()->OnFocusNoLongerOnForm(had_interacted_form); + }); + } + +@@ -604,15 +604,15 @@ void ContentAutofillDriver::FocusOnFormField(const FormData& raw_form, + const FormFieldData& field, const gfx::RectF& bounding_box) { + target->GetAutofillManager().OnFocusOnFormField(WithNewVersion(form), + field, bounding_box); +- if (target->secondary_autofill_manager_) { +- target->secondary_autofill_manager_->OnFocusOnFormField( ++ if (target->secondary_autofill_manager()) { ++ target->secondary_autofill_manager()->OnFocusOnFormField( + WithNewVersion(form), field, bounding_box); + } + }, + [](autofill::AutofillDriver* target) { + target->GetAutofillManager().OnFocusNoLongerOnForm(true); +- if (target->secondary_autofill_manager_) { +- target->secondary_autofill_manager_->OnFocusNoLongerOnForm(true); ++ if (target->secondary_autofill_manager()) { ++ target->secondary_autofill_manager()->OnFocusNoLongerOnForm(true); + } + }); + } +@@ -628,8 +628,8 @@ void ContentAutofillDriver::DidFillAutofillFormData(const FormData& raw_form, + base::TimeTicks timestamp) { + target->GetAutofillManager().OnDidFillAutofillFormData( + WithNewVersion(form), timestamp); +- if (target->secondary_autofill_manager_) { +- target->secondary_autofill_manager_->OnDidFillAutofillFormData( ++ if (target->secondary_autofill_manager()) { ++ target->secondary_autofill_manager()->OnDidFillAutofillFormData( + WithNewVersion(form), timestamp); + } + }); +@@ -641,8 +641,8 @@ void ContentAutofillDriver::DidEndTextFieldEditing() { + } + router().DidEndTextFieldEditing(this, [](autofill::AutofillDriver* target) { + target->GetAutofillManager().OnDidEndTextFieldEditing(); +- if (target->secondary_autofill_manager_) +- target->secondary_autofill_manager_->OnDidEndTextFieldEditing(); ++ if (target->secondary_autofill_manager()) ++ target->secondary_autofill_manager()->OnDidEndTextFieldEditing(); + }); + } + +@@ -657,8 +657,8 @@ void ContentAutofillDriver::SelectOrSelectListFieldOptionsDidChange( + cast(target) + ->GetAutofillManager() + .OnSelectOrSelectListFieldOptionsDidChange(WithNewVersion(form)); +- if (target->secondary_autofill_manager_) { +- target->secondary_autofill_manager_->OnSelectOrSelectMenuFieldOptionsDidChange( ++ if (target->secondary_autofill_manager()) { ++ target->secondary_autofill_manager()->OnSelectOrSelectListFieldOptionsDidChange( + WithNewVersion(form)); + } + }); +@@ -680,8 +680,8 @@ void ContentAutofillDriver::JavaScriptChangedAutofilledValue( + const FormFieldData& field, const std::u16string& old_value) { + target->GetAutofillManager().OnJavaScriptChangedAutofilledValue( + WithNewVersion(form), field, old_value); +- if (target->secondary_autofill_manager_) { +- target->secondary_autofill_manager_->OnJavaScriptChangedAutofilledValue( ++ if (target->secondary_autofill_manager()) { ++ target->secondary_autofill_manager()->OnJavaScriptChangedAutofilledValue( + WithNewVersion(form), field, old_value); + } + }); +@@ -696,8 +696,8 @@ void ContentAutofillDriver::OnContextMenuShownInField( + const FieldGlobalId& field_global_id) { + target->GetAutofillManager().OnContextMenuShownInField(form_global_id, + field_global_id); +- if (target->secondary_autofill_manager_) +- target->secondary_autofill_manager_->OnContextMenuShownInField(form_global_id, field_global_id); ++ if (target->secondary_autofill_manager()) ++ target->secondary_autofill_manager()->OnContextMenuShownInField(form_global_id, field_global_id); + }); + } + +@@ -722,6 +722,10 @@ ContentAutofillDriver::GetAutofillAgent() { + return autofill_agent_; + } + ++raw_ptr ContentAutofillDriver::secondary_autofill_manager() { ++ return secondary_autofill_manager_.get(); ++} ++ + void ContentAutofillDriver::SetFrameAndFormMetaData( + FormData& form, + FormFieldData* optional_field) const { +diff --git a/components/autofill/content/browser/content_autofill_driver.h b/components/autofill/content/browser/content_autofill_driver.h +--- a/components/autofill/content/browser/content_autofill_driver.h ++++ b/components/autofill/content/browser/content_autofill_driver.h +@@ -131,7 +131,7 @@ class ContentAutofillDriver : public AutofillDriver, + autofill_manager_ = std::move(autofill_manager); + secondary_autofill_manager_ = std::move(secondary_autofill_manager); + } +- AutofillManager* secondary_autofill_manager() { return secondary_autofill_manager_.get(); } ++ raw_ptr secondary_autofill_manager() override; + + content::RenderFrameHost* render_frame_host() { return &*render_frame_host_; } + const content::RenderFrameHost* render_frame_host() const { +diff --git a/components/autofill/core/browser/autofill_driver.h b/components/autofill/core/browser/autofill_driver.h +--- a/components/autofill/core/browser/autofill_driver.h ++++ b/components/autofill/core/browser/autofill_driver.h +@@ -69,6 +69,8 @@ class AutofillDriver { + // Returns the AutofillManager owned by the AutofillDriver. + virtual AutofillManager& GetAutofillManager() = 0; + ++ virtual raw_ptr secondary_autofill_manager() = 0; ++ + // Returns whether the AutofillDriver instance is associated with an active + // frame in the MPArch sense. + virtual bool IsInActiveFrame() const = 0; diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/PermissionInfo.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/PermissionInfo.java --- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/PermissionInfo.java +++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/PermissionInfo.java @@ -1001,27 +1205,24 @@ diff --git a/components/permissions/contexts/geolocation_permission_context_andr diff --git a/components/permissions/permission_context_base.cc b/components/permissions/permission_context_base.cc --- a/components/permissions/permission_context_base.cc +++ b/components/permissions/permission_context_base.cc -@@ -257,6 +257,19 @@ PermissionContextBase::CreatePermissionRequest( +@@ -257,6 +257,16 @@ PermissionContextBase::CreatePermissionRequest( std::move(delete_callback)); } +std::unique_ptr PermissionContextBase::CreatePermissionRequest( -+ const GURL& request_origin, -+ ContentSettingsType content_settings_type, -+ bool has_gesture, + content::WebContents* web_contents, ++ PermissionRequestData request_data, + PermissionRequest::PermissionDecidedCallbackWithLifetime permission_decided_callback, + base::OnceClosure delete_callback) const { + return std::make_unique( -+ request_origin, ContentSettingsTypeToRequestType(content_settings_type), -+ has_gesture, std::move(permission_decided_callback), ++ std::move(request_data), std::move(permission_decided_callback), + std::move(delete_callback)); +} + content::PermissionResult PermissionContextBase::GetPermissionStatus( content::RenderFrameHost* render_frame_host, const GURL& requesting_origin, -@@ -466,7 +479,8 @@ void PermissionContextBase::PermissionDecided(const PermissionRequestID& id, +@@ -466,7 +476,8 @@ void PermissionContextBase::PermissionDecided(const PermissionRequestID& id, const GURL& embedding_origin, ContentSetting content_setting, bool is_one_time, @@ -1031,7 +1232,7 @@ diff --git a/components/permissions/permission_context_base.cc b/components/perm DCHECK(content_setting == CONTENT_SETTING_ALLOW || content_setting == CONTENT_SETTING_BLOCK || content_setting == CONTENT_SETTING_DEFAULT); -@@ -481,13 +495,14 @@ void PermissionContextBase::PermissionDecided(const PermissionRequestID& id, +@@ -481,13 +492,14 @@ void PermissionContextBase::PermissionDecided(const PermissionRequestID& id, // missing if a permission prompt was preignored and we already notified an // origin about it. if (request->second.second) { @@ -1050,7 +1251,7 @@ diff --git a/components/permissions/permission_context_base.cc b/components/perm } } -@@ -539,11 +554,27 @@ void PermissionContextBase::NotifyPermissionSet( +@@ -539,11 +551,27 @@ void PermissionContextBase::NotifyPermissionSet( ContentSetting content_setting, bool is_one_time, bool is_final_decision) { @@ -1079,7 +1280,7 @@ diff --git a/components/permissions/permission_context_base.cc b/components/perm } if (is_final_decision) { -@@ -573,6 +604,15 @@ void PermissionContextBase::UpdateContentSetting(const GURL& requesting_origin, +@@ -573,6 +601,15 @@ void PermissionContextBase::UpdateContentSetting(const GURL& requesting_origin, const GURL& embedding_origin, ContentSetting content_setting, bool is_one_time) { @@ -1095,7 +1296,7 @@ diff --git a/components/permissions/permission_context_base.cc b/components/perm DCHECK_EQ(requesting_origin, requesting_origin.DeprecatedGetOriginAsURL()); DCHECK_EQ(embedding_origin, embedding_origin.DeprecatedGetOriginAsURL()); DCHECK(content_setting == CONTENT_SETTING_ALLOW || -@@ -582,6 +622,8 @@ void PermissionContextBase::UpdateContentSetting(const GURL& requesting_origin, +@@ -582,6 +619,8 @@ void PermissionContextBase::UpdateContentSetting(const GURL& requesting_origin, constraints.set_session_model(is_one_time ? content_settings::SessionModel::OneTime : content_settings::SessionModel::Durable); @@ -1135,22 +1336,20 @@ diff --git a/components/permissions/permission_context_base.h b/components/permi virtual void UpdateContentSetting(const GURL& requesting_origin, const GURL& embedding_origin, ContentSetting content_setting, -@@ -194,6 +208,14 @@ class PermissionContextBase : public content_settings::Observer { +@@ -194,6 +208,12 @@ class PermissionContextBase : public content_settings::Observer { PermissionRequest::PermissionDecidedCallback permission_decided_callback, base::OnceClosure delete_callback) const; + virtual std::unique_ptr CreatePermissionRequest( -+ const GURL& request_origin, -+ ContentSettingsType content_settings_type, -+ bool has_gesture, + content::WebContents* web_contents, ++ PermissionRequestData request_data, + PermissionRequest::PermissionDecidedCallbackWithLifetime permission_decided_callback, + base::OnceClosure delete_callback) const; + base::ObserverList permission_observers_; // Set by subclasses to inform the base class that they will handle adding -@@ -216,7 +238,8 @@ class PermissionContextBase : public content_settings::Observer { +@@ -216,7 +236,8 @@ class PermissionContextBase : public content_settings::Observer { const GURL& embedding_origin, ContentSetting content_setting, bool is_one_time, @@ -1177,26 +1376,22 @@ diff --git a/components/permissions/permission_prompt.h b/components/permissions diff --git a/components/permissions/permission_request.cc b/components/permissions/permission_request.cc --- a/components/permissions/permission_request.cc +++ b/components/permissions/permission_request.cc -@@ -35,6 +35,18 @@ PermissionRequest::PermissionRequest( +@@ -35,6 +35,14 @@ PermissionRequest::PermissionRequest( permission_decided_callback_(std::move(permission_decided_callback)), delete_callback_(std::move(delete_callback)) {} +PermissionRequest::PermissionRequest( -+ const GURL& requesting_origin, -+ RequestType request_type, -+ bool has_gesture, ++ PermissionRequestData request_data, + PermissionDecidedCallbackWithLifetime permission_decided_callback, + base::OnceClosure delete_callback) -+ : requesting_origin_(requesting_origin), -+ request_type_(request_type), -+ has_gesture_(has_gesture), ++ : data_(std::move(request_data)), + permission_decided_callback_withlifetime_(std::move(permission_decided_callback)), + delete_callback_(std::move(delete_callback)) {} + PermissionRequest::~PermissionRequest() { DCHECK(delete_callback_.is_null()); } -@@ -274,19 +286,37 @@ bool PermissionRequest::ShouldUseTwoOriginPrompt() const { +@@ -274,19 +282,37 @@ bool PermissionRequest::ShouldUseTwoOriginPrompt() const { permissions::features::kPermissionStorageAccessAPI); } @@ -1251,20 +1446,18 @@ diff --git a/components/permissions/permission_request.h b/components/permission // `permission_decided_callback` is called when the permission request is // resolved by the user (see comment on PermissionDecidedCallback above). // `delete_callback` is called when the permission request is no longer needed -@@ -63,6 +68,12 @@ class PermissionRequest { +@@ -63,6 +68,10 @@ class PermissionRequest { PermissionDecidedCallback permission_decided_callback, base::OnceClosure delete_callback); -+ PermissionRequest(const GURL& requesting_origin, -+ RequestType request_type, -+ bool has_gesture, ++ PermissionRequest(PermissionRequestData request_data, + PermissionDecidedCallbackWithLifetime permission_decided_callback, + base::OnceClosure delete_callback); + PermissionRequest(const PermissionRequest&) = delete; PermissionRequest& operator=(const PermissionRequest&) = delete; -@@ -128,10 +139,10 @@ class PermissionRequest { +@@ -128,10 +137,10 @@ class PermissionRequest { // If |is_one_time| is true the permission will last until all tabs of // |origin| are closed or navigated away from, and then the permission will // automatically expire after 1 day. @@ -1277,7 +1470,7 @@ diff --git a/components/permissions/permission_request.h b/components/permission // Called when the user has cancelled the permission request. This // corresponds to a denial, but is segregated in case the context needs to -@@ -170,6 +181,9 @@ class PermissionRequest { +@@ -170,6 +179,9 @@ class PermissionRequest { // Called once a decision is made about the permission. PermissionDecidedCallback permission_decided_callback_; diff --git a/build/patches/Content-settings-infrastructure.patch b/build/patches/Content-settings-infrastructure.patch index abc0c09f..b26c7aad 100644 --- a/build/patches/Content-settings-infrastructure.patch +++ b/build/patches/Content-settings-infrastructure.patch @@ -17,7 +17,7 @@ Require: bromite-build-utils.patch .../settings/privacy_page/privacy_page.ts | 44 ++- chrome/browser/resources/settings/route.ts | 2 + .../settings_category_default_radio_group.ts | 7 + - .../settings/site_settings/site_details.html | 2 + + .../settings/site_settings/site_details.html | 1 + .../settings/site_settings/site_details.ts | 16 +- .../site_settings_page/site_settings_page.ts | 28 +- .../site_settings_page_util.ts | 55 ++++ @@ -72,7 +72,7 @@ Require: bromite-build-utils.patch .../execution_context/execution_context.cc | 16 + .../execution_context/execution_context.h | 5 + .../WebLayerSiteSettingsDelegate.java | 3 + - 61 files changed, 1189 insertions(+), 42 deletions(-) + 61 files changed, 1188 insertions(+), 42 deletions(-) create mode 100644 components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/BromiteCustomContentSetting.java create mode 100644 components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/BromiteCustomContentSettingImpl.java create mode 100644 components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/BromiteCustomTriStateSiteSettingsPreferenceImpl.java @@ -228,15 +228,12 @@ diff --git a/chrome/browser/resources/settings/site_settings/settings_category_d diff --git a/chrome/browser/resources/settings/site_settings/site_details.html b/chrome/browser/resources/settings/site_settings/site_details.html --- a/chrome/browser/resources/settings/site_settings/site_details.html +++ b/chrome/browser/resources/settings/site_settings/site_details.html -@@ -267,6 +267,8 @@ - icon="settings:local-fonts" label="$i18n{fonts}"> - - +
-+
- - diff --git a/chrome/browser/resources/settings/site_settings/site_details.ts b/chrome/browser/resources/settings/site_settings/site_details.ts --- a/chrome/browser/resources/settings/site_settings/site_details.ts +++ b/chrome/browser/resources/settings/site_settings/site_details.ts diff --git a/build/patches/Disable-all-predictors-code.patch b/build/patches/Disable-all-predictors-code.patch index c94c30c6..151cac15 100644 --- a/build/patches/Disable-all-predictors-code.patch +++ b/build/patches/Disable-all-predictors-code.patch @@ -5,25 +5,46 @@ Subject: Disable all predictors code Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html --- - chrome/browser/browser_features.cc | 16 +++---- + chrome/browser/BUILD.gn | 8 +-- + chrome/browser/browser_features.cc | 16 +++--- + .../preloading_model_keyed_service.cc | 8 --- + .../preloading_model_keyed_service_factory.cc | 4 +- .../ranking/history_clusters_module_ranker.cc | 3 +- .../chrome_hints_manager.cc | 1 + .../optimization_guide_keyed_service.cc | 1 - .../browser/predictors/loading_predictor.cc | 4 +- .../predictors/loading_predictor_config.cc | 4 +- - .../browser/predictors/predictors_features.cc | 14 ++---- + .../browser/predictors/predictors_features.cc | 14 ++--- chrome/common/chrome_features.cc | 10 ++-- .../optimization_guide/core/hints_fetcher.cc | 1 + .../optimization_guide/core/hints_manager.cc | 5 ++ - .../core/optimization_guide_features.cc | 46 +++++++++---------- + .../core/optimization_guide_features.cc | 53 ++++++++----------- .../core/prediction_model_download_manager.cc | 6 ++- .../core/prediction_model_fetcher_impl.cc | 1 + components/optimization_guide/features.gni | 3 +- - components/permissions/features.cc | 8 ++-- - third_party/blink/common/features.cc | 8 +--- + components/permissions/features.cc | 8 +-- + third_party/blink/common/features.cc | 12 ++--- .../platform/runtime_enabled_features.json5 | 2 +- - 17 files changed, 63 insertions(+), 70 deletions(-) + 20 files changed, 70 insertions(+), 94 deletions(-) +diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn +--- a/chrome/browser/BUILD.gn ++++ b/chrome/browser/BUILD.gn +@@ -890,10 +890,10 @@ static_library("browser") { + "navigation_predictor/navigation_predictor_metrics_document_data.h", + "navigation_predictor/navigation_predictor_preconnect_client.cc", + "navigation_predictor/navigation_predictor_preconnect_client.h", +- "navigation_predictor/preloading_model_executor.cc", +- "navigation_predictor/preloading_model_executor.h", +- "navigation_predictor/preloading_model_handler.cc", +- "navigation_predictor/preloading_model_handler.h", ++ # "navigation_predictor/preloading_model_executor.cc", ++ # "navigation_predictor/preloading_model_executor.h", ++ # "navigation_predictor/preloading_model_handler.cc", ++ # "navigation_predictor/preloading_model_handler.h", + "navigation_predictor/preloading_model_keyed_service.cc", + "navigation_predictor/preloading_model_keyed_service.h", + "navigation_predictor/preloading_model_keyed_service_factory.cc", diff --git a/chrome/browser/browser_features.cc b/chrome/browser/browser_features.cc --- a/chrome/browser/browser_features.cc +++ b/chrome/browser/browser_features.cc @@ -58,6 +79,36 @@ diff --git a/chrome/browser/browser_features.cc b/chrome/browser/browser_feature const base::FeatureParam::Option search_suggestion_implementation_types[] = { {SearchSuggestionPrerenderImplementationType::kUsePrefetch, +diff --git a/chrome/browser/navigation_predictor/preloading_model_keyed_service.cc b/chrome/browser/navigation_predictor/preloading_model_keyed_service.cc +--- a/chrome/browser/navigation_predictor/preloading_model_keyed_service.cc ++++ b/chrome/browser/navigation_predictor/preloading_model_keyed_service.cc +@@ -10,14 +10,6 @@ PreloadingModelKeyedService::Inputs::Inputs() = default; + + PreloadingModelKeyedService::PreloadingModelKeyedService( + OptimizationGuideKeyedService* optimization_guide_keyed_service) { +- auto* model_provider = +- static_cast( +- optimization_guide_keyed_service); +- +- if (model_provider) { +- preloading_model_handler_ = +- std::make_unique(model_provider); +- } + } + + PreloadingModelKeyedService::~PreloadingModelKeyedService() = default; +diff --git a/chrome/browser/navigation_predictor/preloading_model_keyed_service_factory.cc b/chrome/browser/navigation_predictor/preloading_model_keyed_service_factory.cc +--- a/chrome/browser/navigation_predictor/preloading_model_keyed_service_factory.cc ++++ b/chrome/browser/navigation_predictor/preloading_model_keyed_service_factory.cc +@@ -42,7 +42,5 @@ std::unique_ptr + blink::features::kPreloadingHeuristicsMLModel)) { + return nullptr; + } +- auto* profile = Profile::FromBrowserContext(context); +- return std::make_unique( +- OptimizationGuideKeyedServiceFactory::GetForProfile(profile)); ++ return nullptr; + } diff --git a/chrome/browser/new_tab_page/modules/history_clusters/ranking/history_clusters_module_ranker.cc b/chrome/browser/new_tab_page/modules/history_clusters/ranking/history_clusters_module_ranker.cc --- a/chrome/browser/new_tab_page/modules/history_clusters/ranking/history_clusters_module_ranker.cc +++ b/chrome/browser/new_tab_page/modules/history_clusters/ranking/history_clusters_module_ranker.cc @@ -246,7 +297,21 @@ diff --git a/components/optimization_guide/core/hints_manager.cc b/components/op diff --git a/components/optimization_guide/core/optimization_guide_features.cc b/components/optimization_guide/core/optimization_guide_features.cc --- a/components/optimization_guide/core/optimization_guide_features.cc +++ b/components/optimization_guide/core/optimization_guide_features.cc -@@ -99,17 +99,17 @@ bool IsSupportedLocaleForFeature( +@@ -47,13 +47,6 @@ constexpr auto enabled_by_default_mobile_only = + false; + #endif + +-constexpr auto enabled_by_default_ios_only = +-#if BUILDFLAG(IS_IOS) +- base::FEATURE_ENABLED_BY_DEFAULT; +-#else +- base::FEATURE_DISABLED_BY_DEFAULT; +-#endif +- + // Returns whether |locale| is a supported locale for |feature|. + // + // This matches |locale| with the "supported_locales" feature param value in +@@ -99,17 +92,17 @@ bool IsSupportedLocaleForFeature( // Enables the syncing of the Optimization Hints component, which provides // hints for what optimizations can be applied on a page load. BASE_FEATURE(kOptimizationHints, @@ -270,7 +335,7 @@ diff --git a/components/optimization_guide/core/optimization_guide_features.cc b // Enables performance info in the context menu and fetching from a remote // Optimization Guide Service. -@@ -119,17 +119,13 @@ BASE_FEATURE(kContextMenuPerformanceInfoAndRemoteHintFetching, +@@ -119,17 +112,13 @@ BASE_FEATURE(kContextMenuPerformanceInfoAndRemoteHintFetching, // Enables the prediction of optimization targets. BASE_FEATURE(kOptimizationTargetPrediction, @@ -292,7 +357,7 @@ diff --git a/components/optimization_guide/core/optimization_guide_features.cc b ); // Enables page content to be annotated. -@@ -139,8 +135,8 @@ BASE_FEATURE(kPageContentAnnotations, +@@ -139,8 +128,8 @@ BASE_FEATURE(kPageContentAnnotations, // Enables fetching page metadata from the remote Optimization Guide service. BASE_FEATURE(kRemotePageMetadata, @@ -303,7 +368,7 @@ diff --git a/components/optimization_guide/core/optimization_guide_features.cc b // Enables the page entities model to be annotated on every page load. BASE_FEATURE(kPageEntitiesPageContentAnnotations, -@@ -168,8 +164,8 @@ BASE_FEATURE(kPageEntitiesModelResetOnShutdown, +@@ -168,8 +157,8 @@ BASE_FEATURE(kPageEntitiesModelResetOnShutdown, // Enables push notification of hints. BASE_FEATURE(kPushNotifications, @@ -314,7 +379,7 @@ diff --git a/components/optimization_guide/core/optimization_guide_features.cc b // This feature flag does not turn off any behavior, it is only used for // experiment parameters. -@@ -182,9 +178,9 @@ BASE_FEATURE(kOptimizationGuideMetadataValidation, +@@ -182,9 +171,9 @@ BASE_FEATURE(kOptimizationGuideMetadataValidation, "OptimizationGuideMetadataValidation", base::FEATURE_DISABLED_BY_DEFAULT); @@ -327,7 +392,7 @@ diff --git a/components/optimization_guide/core/optimization_guide_features.cc b BASE_FEATURE(kTextEmbeddingBatchAnnotations, "TextEmbeddingBatchAnnotations", -@@ -196,7 +192,7 @@ BASE_FEATURE(kPageContentAnnotationsValidation, +@@ -196,7 +185,7 @@ BASE_FEATURE(kPageContentAnnotationsValidation, BASE_FEATURE(kPreventLongRunningPredictionModels, "PreventLongRunningPredictionModels", @@ -336,7 +401,7 @@ diff --git a/components/optimization_guide/core/optimization_guide_features.cc b BASE_FEATURE(kOptimizationGuideUseContinueOnShutdownForPageContentAnnotations, "OptimizationGuideUseContinueOnShutdownForPageContentAnnotations", -@@ -231,8 +227,8 @@ BASE_FEATURE(kPageContentAnnotationsPersistSalientImageMetadata, +@@ -231,8 +220,8 @@ BASE_FEATURE(kPageContentAnnotationsPersistSalientImageMetadata, // Killswitch for fetching on search results from a remote Optimization Guide // Service. BASE_FEATURE(kOptimizationGuideFetchingForSRP, @@ -347,7 +412,7 @@ diff --git a/components/optimization_guide/core/optimization_guide_features.cc b // Enables the model store to save relative paths computed from the base model // store dir. Storing as relative path in the model store is needed for IOS, -@@ -511,7 +507,7 @@ size_t MaxURLKeyedHintCacheSize() { +@@ -511,7 +500,7 @@ size_t MaxURLKeyedHintCacheSize() { bool ShouldPersistHintsToDisk() { return GetFieldTrialParamByFeatureAsBool(kOptimizationHints, @@ -455,6 +520,17 @@ diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/fea ); BASE_FEATURE(kNewBaseUrlInheritanceBehavior, +@@ -1323,8 +1319,8 @@ BASE_FEATURE(kPrefetchPrivacyChanges, + base::FEATURE_ENABLED_BY_DEFAULT); // in Bromite + + BASE_FEATURE(kPreloadingHeuristicsMLModel, +- "PreloadingHeuristicsMLModel", +- base::FEATURE_DISABLED_BY_DEFAULT); ++ "PreloadingHeuristicsMLModel", // must be disabled ++ base::FEATURE_DISABLED_BY_DEFAULT); // in cromite + + BASE_FEATURE(kPrerender2InNewTab, + "Prerender2InNewTab", diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5 --- a/third_party/blink/renderer/platform/runtime_enabled_features.json5 +++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5 diff --git a/build/patches/Multiple-fingerprinting-mitigations.patch b/build/patches/Multiple-fingerprinting-mitigations.patch index bde8751e..4c00d484 100644 --- a/build/patches/Multiple-fingerprinting-mitigations.patch +++ b/build/patches/Multiple-fingerprinting-mitigations.patch @@ -497,7 +497,7 @@ diff --git a/third_party/blink/renderer/modules/canvas/canvas2d/base_rendering_c GetState().GetTextAlign(), text); + // Scale text metrics if enabled + if (RuntimeEnabledFeatures::FingerprintingCanvasMeasureTextNoiseEnabled()) { -+ text_metrics->Shuffle(canvas()->GetDocument().GetNoiseFactorX()); ++ text_metrics->Shuffle(canvas->GetDocument().GetNoiseFactorX()); + } + return text_metrics; } diff --git a/build/patches/Remove-binary-blob-integrations.patch b/build/patches/Remove-binary-blob-integrations.patch index f8225d8b..61d161f2 100644 --- a/build/patches/Remove-binary-blob-integrations.patch +++ b/build/patches/Remove-binary-blob-integrations.patch @@ -88,7 +88,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html components/module_installer/android/BUILD.gn | 4 - components/signin/public/android/BUILD.gn | 3 - .../signin/AccountRenameChecker.java | 16 - - components/webauthn/android/BUILD.gn | 11 - + components/webauthn/android/BUILD.gn | 12 - .../webauthn/AuthenticatorImpl.java | 93 +-- .../webauthn/CredManMetricsHelper.java | 17 - .../webauthn/Fido2ApiCallHelper.java | 58 +- @@ -106,7 +106,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html third_party/cardboard/BUILD.gn | 4 - weblayer/browser/java/BUILD.gn | 1 - weblayer/public/java/BUILD.gn | 1 - - 82 files changed, 96 insertions(+), 2010 deletions(-) + 82 files changed, 96 insertions(+), 2011 deletions(-) diff --git a/android_webview/expectations/system_webview_bundle.AndroidManifest.expected b/android_webview/expectations/system_webview_bundle.AndroidManifest.expected --- a/android_webview/expectations/system_webview_bundle.AndroidManifest.expected @@ -3074,9 +3074,11 @@ diff --git a/components/webauthn/android/BUILD.gn b/components/webauthn/android/ "java/src/org/chromium/components/webauthn/InternalAuthenticator.java", "java/src/org/chromium/components/webauthn/WebAuthnBrowserBridge.java", ] -@@ -20,11 +18,7 @@ android_library("java") { +@@ -18,13 +16,8 @@ android_library("java") { + sources = [ + "java/src/org/chromium/components/webauthn/AuthenticatorFactory.java", "java/src/org/chromium/components/webauthn/AuthenticatorImpl.java", - "java/src/org/chromium/components/webauthn/CredManHelper.java", +- "java/src/org/chromium/components/webauthn/CredManHelper.java", "java/src/org/chromium/components/webauthn/CredManMetricsHelper.java", - "java/src/org/chromium/components/webauthn/Fido2Api.java", - "java/src/org/chromium/components/webauthn/Fido2ApiCall.java", @@ -3086,7 +3088,7 @@ diff --git a/components/webauthn/android/BUILD.gn b/components/webauthn/android/ "java/src/org/chromium/components/webauthn/GetAssertionResponseCallback.java", "java/src/org/chromium/components/webauthn/GetMatchingCredentialIdsResponseCallback.java", "java/src/org/chromium/components/webauthn/InternalAuthenticator.java", -@@ -35,9 +29,6 @@ android_library("java") { +@@ -35,9 +28,6 @@ android_library("java") { ] deps = [ @@ -3096,7 +3098,7 @@ diff --git a/components/webauthn/android/BUILD.gn b/components/webauthn/android/ "//base:base_java", "//base:jni_java", "//build/android:build_java", -@@ -90,8 +81,6 @@ android_library("test_support_java") { +@@ -90,8 +80,6 @@ android_library("test_support_java") { source_set("android") { sources = [ diff --git a/build/patches/User-agent-customization.patch b/build/patches/User-agent-customization.patch index 10c6c6af..4782c1f2 100644 --- a/build/patches/User-agent-customization.patch +++ b/build/patches/User-agent-customization.patch @@ -33,14 +33,14 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html .../strings/android_chrome_strings.grd | 35 ++++ chrome/common/pref_names.h | 8 + .../widget/RadioButtonWithEditText.java | 11 + - .../embedder_support/user_agent_utils.cc | 8 +- + .../embedder_support/user_agent_utils.cc | 7 +- .../navigation_controller_android.cc | 4 + .../navigation_controller_android.h | 1 + .../renderer_host/render_process_host_impl.cc | 1 + .../browser/web_contents/web_contents_impl.cc | 4 + .../framehost/NavigationControllerImpl.java | 3 +- content/renderer/render_thread_impl.cc | 1 - - 30 files changed, 749 insertions(+), 18 deletions(-) + 30 files changed, 748 insertions(+), 18 deletions(-) create mode 100644 chrome/android/java/res/layout/custom_useragent_preferences.xml create mode 100644 chrome/android/java/res/xml/useragent_preferences.xml create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/settings/UserAgentPreferences.java @@ -1100,14 +1100,13 @@ diff --git a/components/embedder_support/user_agent_utils.cc b/components/embedd bool enable_updated_grease_by_policy = true; if (pref_service) { -@@ -513,7 +517,9 @@ void SetDesktopUserAgentOverride(content::WebContents* web_contents, +@@ -513,7 +517,8 @@ void SetDesktopUserAgentOverride(content::WebContents* web_contents, blink::UserAgentOverride spoofed_ua; spoofed_ua.ua_string_override = content::BuildUserAgentFromOSAndProduct( - kLinuxInfoStr, GetProductAndVersion()); + kLinuxInfoStr, -+ GetProductAndVersion(ForceMajorVersionToMinorPosition::kDefault, -+ UserAgentReductionEnterprisePolicyState::kForceEnabled)); ++ GetProductAndVersion(UserAgentReductionEnterprisePolicyState::kForceEnabled)); spoofed_ua.ua_metadata_override = metadata; spoofed_ua.ua_metadata_override->platform = "Linux"; spoofed_ua.ua_metadata_override->platform_version = diff --git a/build/patches/eyeo-117.0.5938.0-android_api.patch b/build/patches/eyeo-117.0.5938.0-android_api.patch index 3facb5b9..b9986e5e 100644 --- a/build/patches/eyeo-117.0.5938.0-android_api.patch +++ b/build/patches/eyeo-117.0.5938.0-android_api.patch @@ -21,7 +21,7 @@ Pre-requisites: eyeo Browser Ad filtering Solution: Base Module ...lassification_notifier_bindings_factory.cc | 71 +++ ...classification_notifier_bindings_factory.h | 52 ++ ...hrome_browser_main_extra_parts_profiles.cc | 10 + - components/adblock/android/BUILD.gn | 110 ++++ + components/adblock/android/BUILD.gn | 111 ++++ .../adblock_settings_locales_titles.xml | 98 ++++ .../adblock/AdblockContentType.java | 62 ++ .../components/adblock/AdblockController.java | 258 +++++++++ @@ -46,7 +46,7 @@ Pre-requisites: eyeo Browser Ad filtering Solution: Base Module .../adblock/TestPagesTestsHelper.java | 255 ++++++++ .../adblock/TestPagesWebsocketTest.java | 77 +++ .../adblock/TestVerificationUtils.java | 166 ++++++ - 40 files changed, 5936 insertions(+) + 40 files changed, 5937 insertions(+) create mode 100644 chrome/browser/android/adblock/adblock_jni.cc create mode 100644 chrome/browser/android/adblock/adblock_jni.h create mode 100644 chrome/browser/android/adblock/adblock_jni_factory.cc @@ -1446,7 +1446,7 @@ diff --git a/components/adblock/android/BUILD.gn b/components/adblock/android/BU new file mode 100644 --- /dev/null +++ b/components/adblock/android/BUILD.gn -@@ -0,0 +1,110 @@ +@@ -0,0 +1,111 @@ +# This file is part of eyeo Chromium SDK, +# Copyright (C) 2006-present eyeo GmbH +# eyeo Chromium SDK is free software: you can redistribute it and/or modify @@ -1482,6 +1482,7 @@ new file mode 100644 + "//build/android:build_java", + "//chrome/browser/preferences:java", + "//chrome/browser/profiles/android:java", ++ "//content/public/android:content_full_java", + "//components/browser_ui/settings/android:java", + "//components/prefs/android:java", + "//components/user_prefs/android:java",