Explorar el Código

Pull request #21: AP9-4221 Update the Chromium application to the latest version, from 95.0.4638.78 -> 98.0.4758.108

Merge in AP/chromiumpatches from upstream-98.0.4758.108 to master

* commit 'ea477210f4f7c4f64f0749d3e09f1f606116a82a': (46 commits)
  update to 98.0.4758.108, fix the conflict
  Release 98.0.4758.108
  Patches for v98 (#1806)
  Fix an URL in FAQs (#1815)
  Remove unused patch
  Release 97.0.4692.106
  Patches for v97 (#1795)
  Updated automated domain substitution patch
  Rename GN_ARGS -> bromite.gn_args
  Add missing architectures
  Adjust issue forms
  Minor patch updates for v97
  Migrate to using GitHub issue forms
  Add FAQ about default search engine
  Remove [PATCH] from patches
  Resolve issue #1749 : build with '-ftrivial-auto-var-init=zero'
  Release 96.0.4664.183
  Update zh_CN translations (#1696)
  Updated CHANGELOG
  Release 96.0.4664.104
  ...
wuyifeng hace 3 años
padre
commit
25089f2b45
Se han modificado 100 ficheros con 5149 adiciones y 2157 borrados
  1. 0 89
      .github/ISSUE_TEMPLATE/bug_report.md
  2. 206 0
      .github/ISSUE_TEMPLATE/bug_report.yml
  3. 0 35
      .github/ISSUE_TEMPLATE/feature_request.md
  4. 65 0
      .github/ISSUE_TEMPLATE/feature_request.yml
  5. 45 1
      CHANGELOG.md
  6. 9 3
      FAQ.md
  7. 19 14
      README.md
  8. 1 1
      build/RELEASE
  9. 47 0
      build/bromite.gn_args
  10. 37 19
      build/bromite_patches_list.txt
  11. 44 0
      build/chromium.gn_args
  12. 7 0
      build/chromium_patches_list.txt
  13. 24 21
      build/patches/AImageReader-CFI-crash-mitigations.patch
  14. 2 3
      build/patches/API-level-21-prevent-crash-on-download.patch
  15. 17 18
      build/patches/AV1-codec-support.patch
  16. 9 10
      build/patches/Add-AllowUserCertificates-flag.patch
  17. 2 3
      build/patches/Add-Alt-D-hotkey-to-focus-address-bar.patch
  18. 197 169
      build/patches/Add-DuckDuckGo-Lite-search-engine.patch
  19. 145 146
      build/patches/Add-English-only-search-engine.patch
  20. 16 17
      build/patches/Add-IsCleartextPermitted-flag.patch
  21. 7 8
      build/patches/Add-a-flag-to-allow-screenshots-in-Incognito-mode.patch
  22. 52 56
      build/patches/Add-a-proxy-configuration-page.patch
  23. 70 43
      build/patches/Add-an-always-incognito-mode.patch
  24. 88 94
      build/patches/Add-bookmark-import-export-actions.patch
  25. 16 17
      build/patches/Add-custom-tab-intents-privacy-option.patch
  26. 33 14
      build/patches/Add-exit-menu-item.patch
  27. 8 9
      build/patches/Add-flag-for-omnibox-autocomplete-filtering.patch
  28. 7 8
      build/patches/Add-flag-for-save-data-header.patch
  29. 11 12
      build/patches/Add-flag-to-configure-maximum-connections-per-host.patch
  30. 7 8
      build/patches/Add-flag-to-control-video-playback-resume-feature.patch
  31. 10 11
      build/patches/Add-flag-to-disable-IPv6-probes.patch
  32. 10 11
      build/patches/Add-flag-to-disable-WebGL.patch
  33. 7 8
      build/patches/Add-flag-to-disable-external-intent-requests.patch
  34. 21 21
      build/patches/Add-flag-to-disable-vibration.patch
  35. 72 79
      build/patches/Add-history-support-in-incognito-mode.patch
  36. 61 90
      build/patches/Add-menu-item-to-bookmark-all-tabs.patch
  37. 14 15
      build/patches/Add-menu-item-to-view-source.patch
  38. 45 32
      build/patches/Add-option-to-force-tablet-UI.patch
  39. 16 17
      build/patches/Add-option-to-not-persist-tabs-across-sessions.patch
  40. 205 0
      build/patches/Add-option-to-use-home-page-as-NTP.patch
  41. 7 8
      build/patches/Add-support-for-ISupportHelpAndFeedback.patch
  42. 238 78
      build/patches/Allow-building-without-enable_reporting.patch
  43. 74 0
      build/patches/Allow-building-without-supervised-users.patch
  44. 5 6
      build/patches/Allow-playing-audio-in-background.patch
  45. 6 7
      build/patches/Allow-website-sign-in-without-account-sign-in.patch
  46. 3 4
      build/patches/Always-allow-partner-customisation.patch
  47. 4 5
      build/patches/Always-use-new-tab-page-for-default-home-page.patch
  48. 61 0
      build/patches/Ask-user-before-closing-all-tabs.patch
  49. 3 4
      build/patches/AudioBuffer-AnalyserNode-fp-mitigations.patch
  50. 291 122
      build/patches/Automated-domain-substitution.patch
  51. 4 5
      build/patches/Battery-API-return-nothing.patch
  52. 17 14
      build/patches/Block-gateway-attacks-via-websockets.patch
  53. 34 34
      build/patches/Block-qjz9zk-or-trk-requests.patch
  54. 54 107
      build/patches/Bromite-AdBlockUpdaterService.patch
  55. 579 105
      build/patches/Bromite-auto-updater.patch
  56. 22 0
      build/patches/Bromite-package-name.patch
  57. 4 5
      build/patches/Change-default-webRTC-policy-to-not-use-any-address.patch
  58. 22 0
      build/patches/Chromium-package-name.patch
  59. 58 0
      build/patches/Client-hints-overrides.patch
  60. 5 6
      build/patches/Disable-AGSA-by-default.patch
  61. 58 0
      build/patches/Disable-Accessibility-service-by-default.patch
  62. 3 4
      build/patches/Disable-DRM-media-origin-IDs-preprovisioning.patch
  63. 518 0
      build/patches/Disable-FLoC.patch
  64. 0 54
      build/patches/Disable-HEAD-requests-for-single-word-Omnibar-searches.patch
  65. 2 3
      build/patches/Disable-NTP-remote-suggestions-by-default.patch
  66. 4 5
      build/patches/Disable-all-promo-dialogs.patch
  67. 3 4
      build/patches/Disable-autofill-assistant-by-default.patch
  68. 347 0
      build/patches/Disable-conversion-measurement-api.patch
  69. 9 10
      build/patches/Disable-feeds-support-by-default.patch
  70. 184 7
      build/patches/Disable-fetching-of-all-field-trials.patch
  71. 22 0
      build/patches/Disable-idle-detection.patch
  72. 2 3
      build/patches/Disable-lock-icon-in-address-bar-by-default.patch
  73. 7 8
      build/patches/Disable-media-router-and-remoting-by-default.patch
  74. 34 22
      build/patches/Disable-metrics-collection-for-NTP-tiles.patch
  75. 3 4
      build/patches/Disable-metrics-on-all-I-O-threads.patch
  76. 3 5
      build/patches/Disable-offline-pages-in-CCT.patch
  77. 3 4
      build/patches/Disable-omission-of-URL-elements-in-Omnibox.patch
  78. 3 4
      build/patches/Disable-plugins-enumeration.patch
  79. 147 0
      build/patches/Disable-privacy-sandbox.patch
  80. 3 4
      build/patches/Disable-references-to-fonts.googleapis.com.patch
  81. 28 0
      build/patches/Disable-requests-for-single-word-Omnibar-searches.patch
  82. 194 171
      build/patches/Disable-safe-browsing.patch
  83. 0 23
      build/patches/Disable-search-engine-DSE-automatic-permission.patch
  84. 0 37
      build/patches/Disable-seed-based-field-trials.patch
  85. 18 19
      build/patches/Disable-smart-selection-by-default.patch
  86. 7 8
      build/patches/Disable-some-signed-exchange-features.patch
  87. 5 6
      build/patches/Disable-support-for-RAR-files-inspection.patch
  88. 78 46
      build/patches/Disable-text-fragments-by-default.patch
  89. 4 5
      build/patches/Disable-the-DIAL-repeating-discovery.patch
  90. 14 16
      build/patches/Disable-third-party-cookies-by-default.patch
  91. 158 35
      build/patches/Disable-third-party-origin-trials.patch
  92. 3 4
      build/patches/Disable-unified-autoplay-feature.patch
  93. 2 3
      build/patches/Disable-update-scheduler.patch
  94. 89 0
      build/patches/Disable-various-metrics.patch
  95. 5 6
      build/patches/Do-not-build-API-keys-infobar.patch
  96. 9 10
      build/patches/Do-not-compile-QR-code-sharing.patch
  97. 3 4
      build/patches/Do-not-hide-component-extensions.patch
  98. 8 8
      build/patches/Do-not-ignore-download-location-prompt-setting.patch
  99. 24 0
      build/patches/Do-not-link-with-libatomic.patch
  100. 2 3
      build/patches/Do-not-store-passwords-by-default.patch

+ 0 - 89
.github/ISSUE_TEMPLATE/bug_report.md

@@ -1,89 +0,0 @@
----
-name: Bug report
-about: Create a Bromite bug report
-
----
-
-<!-- Welcome! Thanks for taking time to submit a bug report.
-Have you read the README? https://github.com/bromite/bromite/blob/master/README.md
-Have you searched the issue tracker? https://github.com/bromite/bromite/issues
-Are you sure this is not a Chromium bug? You have to test with Chromium before submitting a bug.
-Are you using the latest version of Bromite?
-
-If instead of a bug report you want to ask a question then please use the GitHub Discussions: https://github.com/bromite/bromite/discussions
--->
-
-### Bromite version
-
-Version: `89.0...`
-Arch: `arm` or `arm64` or `x86`
-Android version: (example: `9.0`)
-Device model: (example: `SM-G960UZKABST`)
-
-### Flags
-
-These are the flags changed under `chrome://flags`:
-
-<!-- Report all the blue-highlighted flags here, those are the flags with non-default configuration -->
-
-### Is this bug about the SystemWebView?
-
-<!-- No support for SystemWebView installations is provided. -->
-
-Yes/No
-
-### Is the bug reproducible with latest version?
-
-<!-- Do not report bugs which are not reproducible with latest version. -->
-
-Yes/No
-
-### Can the bug be reproduced with corresponding Chromium version?
-
-<!--
-Please pick the same version of Chromium as Bromite from here: https://github.com/bromite/chromium/releases
-If the bug is reproducible then it might be a configuration issue or an upstream bug. Upstream bugs can be reported on the [Chromium issue tracker](https://bugs.chromium.org/p/chromium/issues/list) and do not forget to read [Chromium project bug reporting guidelines](https://www.chromium.org/for-testers/bug-reporting-guidelines) first.
-
-If the bug is related to functionality that does not exist in Chromium then answer "No".
--->
-
-Yes/No
-
-### Is this bug happening in an incognito tab?
-Yes/No
-
-### Allow ads for the site; is the bug caused by the adblocker?
-Yes/No
-
-### Is the bug a crash?
-
-No
-
--- or --
-
-Yes, this is the crash dump:
-```
-<paste here logcat dump individuated with 'adb logcat | grep chromium'>
-```
-
-### Describe the bug
-
-<!-- Write here a clear and concise description of the bug. -->
-
-### Steps to reproduce the bug
-
-Steps to reproduce the bug:
-1. Go to '...'
-2. Click on '...'
-3. Scroll down to '...'
-4. See error
-
-Do not write "any website", specify which URLs can be used to reproduce the issue.
-
-### Expected behavior
-
-<!-- A clear and concise description of what you expected to happen. -->
-
-### Screenshots
-
-<!-- If applicable, add screenshots to help explain your problem. Otherwise remove this section. -->

+ 206 - 0
.github/ISSUE_TEMPLATE/bug_report.yml

@@ -0,0 +1,206 @@
+name: Bug report
+description: Create a Bromite bug report
+body:
+  - type: markdown
+    attributes:
+      value: |
+        Welcome! Thanks for taking the time to submit a bug report.
+        
+        If you are looking for a place to ask a question to the Bromite community then please use the [GitHub Discussions](https://github.com/bromite/bromite/discussions) instead.
+        
+        Make sure you have acknowledged and completed this template before submitting your issue.
+        
+        Please read it carefully: incorrect issues will be automatically closed and ignored.
+        
+  - type: checkboxes
+    id: preliminary_checklist
+    attributes:
+      label: Preliminary checklist
+      options:
+        - label: "I have read the [README](https://github.com/bromite/bromite/blob/master/README.md)"
+          required: true
+        - label: "I have searched the existing issues for my problem. This is a new ticket, NOT a duplicate or related to another open issue."
+          required: true
+        - label: "I have updated Bromite to the latest version. The bug is reproducible on this latest version."
+          required: true
+
+  - type: dropdown
+    id: is_chromium
+    attributes:
+      label: Can the bug be reproduced with corresponding Chromium version?
+      description: |
+          Please pick the same version of Chromium as Bromite from here: https://github.com/bromite/chromium/releases
+          If the bug is reproducible then it might be a configuration issue or an upstream bug. Upstream bugs can be reported on the [Chromium issue tracker](https://bugs.chromium.org/p/chromium/issues/list) and
+          do not forget to read [Chromium project bug reporting guidelines](https://www.chromium.org/for-testers/bug-reporting-guidelines) first.
+          
+          If the bug is related to functionality that does not exist in Chromium then answer "No".
+      multiple: false
+      options:
+        - "Yes"
+        - "No"
+    validations:
+      required: true
+
+  - type: input
+    id: bromite_version
+    attributes:
+      label: Bromite version
+      description: What version of Bromite are you using? Please specify a single version e.g. `96.0.4664.1`. If this is not the latest version then please update and retry before submitting this bug report.
+    validations:
+      required: true
+
+  - type: dropdown
+    id: device_architecture
+    attributes:
+      label: Device architecture
+      multiple: false
+      options:
+        - arm
+        - arm64
+        - arm64-v8a
+        - armeabi-v7a
+        - x86
+        - x64
+    validations:
+      required: true
+
+  - type: dropdown
+    id: android_version
+    attributes:
+      label: Android version
+      multiple: false
+      description: What version of Android are you running?
+      options:
+        - 12
+        - 11
+        - 10
+        - 9
+        - 8.1
+        - 8.0
+        - 7.1
+        - 7.0
+        - 6
+        - 5.1
+        - 5.0
+        - 4.4
+        - 4.3
+        - 4.2
+        - 4.1
+        - 4.0
+    validations:
+      required: true
+
+  - type: input
+    id: device_model
+    attributes:
+      label: Device model
+      description: What is your device model? This can usually be found in your device's settings in the "About" section.
+      placeholder: (e.g. `OnePlus 8 (IN2010)`, or `SM-G960UZKABST`, etc.)
+    validations:
+      required: true
+
+  - type: textarea
+    id: changed_flags
+    attributes:
+      label: Changed flags
+      description: |
+        These are the flags changed under `chrome://flags`.
+        Report all the flags with non-default configuration (they will be blue-highlighted).
+        
+        If no flags are changed then write 'no flags changed'.
+      placeholder: show-overdraw-feedback, enable-parallel-downloading
+    validations:
+      required: true
+
+  - type: dropdown
+    id: is_system_webview
+    attributes:
+      label: Is this bug about the SystemWebView?
+      description: Please note that no support for System WebView installation is provided.
+      multiple: false
+      options:
+        - "Yes"
+        - "No"
+    validations:
+      required: true
+
+  - type: dropdown
+    id: is_incognito
+    attributes:
+      label: Is this bug happening in an incognito tab?
+      multiple: false
+      options:
+        - "Yes"
+        - "No"
+    validations:
+      required: true
+
+  - type: dropdown
+    id: adblock
+    attributes:
+      label: Is this bug caused by the adblocker?
+      description: You can test this by temporarily allowing ads for the site.
+      multiple: false
+      options:
+        - "Yes"
+        - "No"
+    validations:
+      required: true
+
+  - type: textarea
+    id: bug_crash
+    attributes:
+      label: Is this bug a crash?
+      description: |
+        1. No.
+        2. Yes, I have attached the crash report dump that I downloaded from `chrome://crashes`
+        3. Yes, I have copy/pasted the crash dump
+      placeholder: |
+        Drag the crash report dump here to attach it or paste the logcat dump individuated with `adb logcat | grep chromium`.
+    validations:
+      required: true
+
+  - type: textarea
+    id: bug_description
+    attributes:
+      label: Describe the bug
+      description: Write a clear and concise description of the bug.
+    validations:
+      required: true
+
+  - type: textarea
+    id: bug_steps
+    attributes:
+      label: Steps to reproduce the bug
+      description: |
+        Explain how to cause the bug as clearly as possible. Bugs that are not reproducible cannot be investigated.
+        
+        Also, do not write "any website": please specify which URLs can be used to reproduce the issue.
+      placeholder: |
+        Steps to reproduce the bug (e.g.):
+        1. Go to '...'
+        2. Click on '...'
+        3. Scroll down to '...'
+        4. See error
+    validations:
+      required: true
+
+  - type: textarea
+    id: expected_behavior
+    attributes:
+      label: Expected behavior
+      description: A clear and concise description of what you expected to happen.
+    validations:
+      required: true
+
+  - type: textarea
+    id: screenshots
+    attributes:
+      label: Screenshots
+      description: |
+        If applicable, add screenshots to help explain your problem.
+        Otherwise, ignore this section.
+      placeholder: |
+        Drag the screenshot files here to attach them.
+    validations:
+      required: false

+ 0 - 35
.github/ISSUE_TEMPLATE/feature_request.md

@@ -1,35 +0,0 @@
----
-name: Feature request
-about: Suggest a privacy-related idea for this project
-
----
-
-<!-- Welcome! Thanks for taking time to submit a feature request.
-Have you searched the issue tracker? https://github.com/bromite/bromite/issues
-Have you read the F.A.Q.s? https://github.com/bromite/bromite/blob/master/FAQ.md
-Have you read the README? https://github.com/bromite/bromite/blob/master/README.md
-Have you read the Wiki? https://github.com/bromite/bromite/wiki
-
-If instead of a feature request you want to ask a question then please use the GitHub Discussions: https://github.com/bromite/bromite/discussions
-
--->
-
-<!-- Do not submit feature requests for extensions support or adding a search engine. -->
-
-### Is your feature request related to privacy?
-
-<!-- Features that are not related to privacy are not considered. -->
-
-### Is there a patch available for this feature somewhere?
-
-<!-- If yes then provide URL and license information. -->
-
-### Describe the solution you would like
-
-<!-- A clear and concise description of what you want to happen.
-
-Do not ask "I would like feature X which is available in browser Y"; such issues are closed immediately. -->
-
-### Describe alternatives you have considered
-
-<!-- A clear and concise description of any alternative solutions or features you have considered. -->

+ 65 - 0
.github/ISSUE_TEMPLATE/feature_request.yml

@@ -0,0 +1,65 @@
+name: Feature request
+description: Create a Bromite feature request
+body:
+  - type: markdown
+    attributes:
+      value: |
+        Welcome! Thanks for taking time to submit a feature request.
+        
+        If you are looking for a place to ask a question to the Bromite community then please use the [GitHub Discussions](https://github.com/bromite/bromite/discussions) instead.
+        
+        Make sure you have acknowledged and completed this template before submitting your issue.
+        
+        Please read it carefully: incorrect issues will be automatically closed and ignored.
+        
+        Note:
+          - Features unrelated to privacy will not be considered.
+          - Do not ask "I would like feature X which is available in browser Y."
+
+  - type: checkboxes
+    id: preliminary_checklist
+    attributes:
+      label: Preliminary checklist
+      options:
+        - label: "I have read the [README](https://github.com/bromite/bromite/blob/master/README.md)"
+          required: true
+        - label: "I have read the [FAQs](https://github.com/bromite/bromite/blob/master/FAQ.md)."
+          required: true
+        - label: "I have searched [existing issues](https://github.com/bromite/bromite/issues) for my feature request. This is a new issue (NOT a duplicate) and is not related to another issue."
+          required: true
+
+  - type: dropdown
+    id: is_privacy_related
+    attributes:
+      label: Is your feature request related to privacy?
+      description: Features that are not related to privacy are not considered.
+      multiple: false
+      options:
+        - "Yes"
+        - "No"
+    validations:
+      required: true
+
+  - type: textarea
+    id: is_patch_available
+    attributes:
+      label: Is there a patch available for this feature somewhere?
+      description: If yes please provide URL and related license information.
+    validations:
+      required: true
+
+  - type: textarea
+    id: solution_description
+    attributes:
+      label: Describe the solution you would like
+      description: A clear and concise description of what you want to happen.
+    validations:
+      required: true
+
+  - type: textarea
+    id: alternatives_considered
+    attributes:
+      label: Describe alternatives you have considered
+      description: A clear and concise description of any alternative solutions or features you have considered.
+    validations:
+      required: true

+ 45 - 1
CHANGELOG.md

@@ -1,5 +1,49 @@
+# 98.0.4758.108
+* re-introduce flag for text fragments
+* re-introduce content feature flag to disable field trials
+* disable idle detection
+* disable critical client hints
+* disable supervised users
+* partial fix for incognito notification (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1503)
+* consider websockets 'unknown' address space as 'public' (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1693)
+* fix crash when accessing site settings of some sites (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1355)
+
+# 97.0.4692.106
+* disable url-keyed metrics reporting service (thanks to @uazo)
+* disable mobile identity consistency by default
+* disable appending variations header
+* use Google Chrome branding for client hints
+* make HTTPS-only mode enabled by default
+* enable trivial auto var init (thanks to @BayLee4, fixes https://github.com/bromite/bromite/issues/1749)
+* enable use_cfi_cast
+
+# 96.0.4664.183
+* updated zh_CN translations (thanks to @zhmars)
+
+# 96.0.4664.104
+* separate patches for package name
+
+# 96.0.4664.54
+* restored offline-indicator-v2 flag (fixes https://github.com/bromite/bromite/issues/1588)
+* re-introduced option to use home page as NTP (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1519)
+* ask user before closing all tabs (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1561)
+* fix crash on always incognito on tablet (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1611)
+* dropped patch to not upload crash data
+* fix autofill pop-up not appearing (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1534)
+
+# 95.0.4638.79
+* improvements for field trials disable patch (thanks to @uazo)
+* remove privacy sandbox UI leftover (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1560)
+* disable conversion measurement API (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1531)
+* remove all code related to FLoC (thanks to @uazo)
+* remove all code related to ENABLE_REPORTING (thanks to @uazo)
+* enable ad-tagging feature
+* SystemWebView: ignore StrictMode warning (thanks to @jylitalbit, https://github.com/bromite/bromite/pull/1567)
+* improvements for field trials fetch patch (thanks to @uazo)
+* disable accessibility service by default (thanks to @uazo, https://github.com/bromite/bromite/pull/1559)
+
 # 95.0.4638.78
-* disable third-party originl trials
+* disable third-party origin trials (fixes https://github.com/bromite/bromite/issues/1530)
 * dropped patch for async DNS flag
 * dropped duplicate patch for pull-to-refresh flag
 * fix application not closing on incognito tab (thanks to @uazo, fixes https://github.com/bromite/bromite/issues/1503)

+ 9 - 3
FAQ.md

@@ -20,7 +20,7 @@ Projects which follow a strict approach on this are [Iridium](https://iridiumbro
 
 Yes, in order to play protected/encrypted media content the browser will use Android's DRM media framework to automatically negotiate access (same as Chromium).
 This means for example that requests to Android license servers will be performed (`www.googleapis.com`), see https://w3c.github.io/encrypted-media/#direct-individualization
-To disable this functionality you should disable protected content playback from Site settings -> Multimedia.
+To disable this functionality you should disable protected content playback from Site settings -> Protected Content.
 
 ## What is the SystemWebView?
 It is the core component of Android for all web page visualizations. For example when you access a new wifi network and need to activate it, that is using the SystemWebView. If you do not know what it is then you do not need to install it.
@@ -31,7 +31,7 @@ Ad-blocking was present and always enabled in the SystemWebView from version `72
 
 ## How to enable DNS-over-HTTPS?
 
-See [this wiki page](https://github.com/bromite/bromite/wiki/Enabling-DNS-over-HTTPS).
+See [this page](https://www.bromite.org/doh).
 
 ## Can you add HTTPS everywhere?
 No.
@@ -78,4 +78,10 @@ Yes, since version 94.0.4606.109 the native Android autofill can be used; this d
 
 ## Does Bromite support casting media content?
 
-No; this would require Play Store binary blobs.
+No, this would require Play Store binary blobs.
+
+## Can you add this search engine as default?
+No.
+Bromite does not make any choice related to default search engines, the Chromium default is used.
+Various Android browsers get some fee to ship their apps with a specific default search engine, Bromite does not get any fee from anyone.
+Changing the default search engine would lead to an endless series of requests to change it based on personal preferences, thus no change is made to the default.

+ 19 - 14
README.md

@@ -52,13 +52,13 @@ cd /tank/chromium4allen/src
 
 ## Prepare Chromium
 
-The patches are intended to be applied to the `95.0.4638.78` tag of
+The patches are intended to be applied to the `98.0.4758.108` tag of
 the Chromium repo. Before continuing, make sure you are on that tag in
 the Chromium source repo:
 
 ```
 git fetch origin
-git checkout -B promethean-95.0.4638.78 95.0.4638.78
+git checkout -B promethean-98.0.4758.108 98.0.4758.108
 gclient sync --with_branch_heads --with_tags
 gclient runhooks
 ```
@@ -88,7 +88,7 @@ done
 ```
 
 All patches should apply cleanly. If they did not, make sure you have
-checked out the proper Chromium tag (95.0.4638.78).
+checked out the proper Chromium tag (98.0.4758.108).
 
 ## Getting the third dependencies
 
@@ -160,11 +160,11 @@ If you do not have an upstream remote, add it with:
 
     git describe --tags --abbrev=0 upstream/master
 
-This will give you output like `94.0.4606.94` which we'll use as an example going forward.
+This will give you output like `98.0.4758.108` which we'll use as an example going forward.
 
 4. Create a new branch based on this tag
 
-    git checkout -b upstream-94.0.4606.94 94.0.4606.94
+    git checkout -b upstream-98.0.4758.108 98.0.4758.108
 
 5. Rebase this branch on the current master
 
@@ -181,14 +181,18 @@ the conflicts pre-resolved. Then rebase onto `origin/master` and -- if
 the rebase succeeds cleanly -- push the new branch.
 
 # Bromite - Take back your browser
-
-<img src="https://www.bromite.org/release.svg" alt="current Bromite release" title="current Bromite release" /> <img src="https://www.bromite.org/license.svg" alt="GNU GPL v3" title="GNU VPL v3" />
-
-<img title="Bromite - take back your browser!" src="https://www.bromite.org/android-icon-192x192.png" width="96" alt="Bromite" />
+<a href="https://github.com/bromite/bromite/releases/latest">
+  <img src="https://www.bromite.org/release.svg" alt="current Bromite release" title="current Bromite release" /> </a>
+<a href="https://github.com/bromite/bromite/blob/master/LICENSE">
+  <img src="https://www.bromite.org/license.svg" alt="GNU GPL v3" title="GNU VPL v3" />
+</a> <br>
+<a href="https://www.bromite.org">
+  <img title="Bromite - take back your browser!" src="https://www.bromite.org/android-icon-192x192.png" width="96" alt="Bromite" />
+</a>
 
 Bromite is a [Chromium](https://www.chromium.org/Home) fork with support for ad blocking and enhanced privacy.
 
-Bromite is only available for Android Lollipop (v5.0, API level 21) and above.
+Bromite is only available for Android Marshmallow (v6.0, API level 23) and above.
 
 <img src="https://fdroid.bromite.org/fdroid/bromite_bromite_gh_downloads.svg" alt="Downloads on Github" title="Downloads on Github" />
 
@@ -207,9 +211,9 @@ Please donate to support development of Bromite and the costs for the build syst
 
 [&rarr; Support development with a donation](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=JP3XTQPVRNET2): [![paypal](https://www.bromite.org/assets/img/btn_donate_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=JP3XTQPVRNET2)
 
-<a href="bitcoin:bc1qmpyuqsvs3tz3uaysplmwjr33gg4rzu6cqweaq834ehc25vduxppqkrszel">BTC donations address</a>: `bc1qmpyuqsvs3tz3uaysplmwjr33gg4rzu6cqweaq834ehc25vduxppqkrszel`
+<a href="bitcoin:bc1qlx7h0lj9z88g2xfeuwsrtfs77sxuhrxf2t28sw">BTC donations address</a>: `bc1qlx7h0lj9z88g2xfeuwsrtfs77sxuhrxf2t28sw`
 
-ETH donations address: `0xf47ff39223d828f99fec5ab53bd068c5c0522042`
+ETH donations address: `0x5d392F8FBf3465afe05B1Adc575e248D33B891F6`
 
 # Features
 
@@ -294,6 +298,7 @@ Flags which have been retired from upstream Chromium but are still available in
 * `#num-raster-threads`
 * `#enable-image-reader`, enabled by default
 * `#enable-tab-groups` and `#enable-tab-groups-ui-improvements`
+* `#offline-indicator-v2`
 
 New flags:
 
@@ -322,7 +327,7 @@ All built versions are available as [releases](https://github.com/bromite/bromit
 
 Each tag corresponds to a Chromium Stable release tag.
 
-Bromite is currently built for ARM, ARM64 and x86 and for the Android SDK versions 19 and 21; [Bromite SystemWebView](https://www.bromite.org/system_web_view) is provided as well (SDK21+).
+Bromite is currently built for ARM, ARM64 and x86 and for the Android SDK version 23+; [Bromite SystemWebView](https://www.bromite.org/system_web_view) is provided as well (SDK23+).
 For every Bromite build you can always find a matching [vanilla Chromium](https://www.bromite.org/chromium) build which is used for example to verify which issues are specific to Bromite or not.
 
 You will automatically receive notifications about new updates (and be able to install them) via the auto updater functionality (enabled by default), see [related wiki page](https://github.com/bromite/bromite/wiki/AutomaticUpdates).
@@ -356,7 +361,7 @@ The [Bromite main repository](https://github.com/bromite/bromite) contains tags
 Please refer to [official Chromium build documentation](https://www.chromium.org/developers/how-tos/get-the-code) to get started on how to build Chromium; if you can build Chromium for Android, you can build Bromite.
 
 The Chromium version tag used as base for the patches is available here: [RELEASE](./build/RELEASE); this is always corresponding to the git tag for every release.
-The GN args used to build Bromite are available here: [GN_ARGS](./build/GN_ARGS).
+The GN args used to build Bromite are available here: [bromite.gn_args](./build/bromite.gn_args).
 The patches are to be applied second the order specified in the `bromite_patches_list.txt` file (you can use `git am`).
 
 ## How to build the filters

+ 1 - 1
build/RELEASE

@@ -1 +1 @@
-95.0.4638.78
+98.0.4758.108

+ 47 - 0
build/bromite.gn_args

@@ -0,0 +1,47 @@
+android_channel="stable"
+blink_symbol_level=1
+chrome_pgo_phase=0
+dcheck_always_on=false
+debuggable_apks=false
+dfmify_dev_ui=false
+disable_android_lint=true
+disable_autofill_assistant_dfm=true
+disable_fieldtrial_testing_config=true
+disable_tab_ui_dfm=true
+enable_av1_decoder=true
+enable_dav1d_decoder=true
+enable_gvr_services=false
+enable_hangout_services_extension=false
+enable_iterator_debugging=false
+enable_mdns=false
+enable_mse_mpeg2ts_stream_parser=true
+enable_nacl=false
+enable_platform_dolby_vision=true
+enable_platform_hevc=true
+enable_remoting=false
+enable_reporting=false
+enable_supervised_users = false
+enable_vr=false
+exclude_unwind_tables=false
+ffmpeg_branding="Chrome"
+icu_use_data_file=true
+is_cfi=true
+is_component_build=false
+is_debug=false
+is_official_build=true
+proprietary_codecs=true
+rtc_build_examples=false
+safe_browsing_mode=0
+symbol_level=1
+system_webview_package_name="org.bromite.webview"
+target_os="android"
+target_cpu="arm"
+treat_warnings_as_errors=false
+use_cfi_cast = true
+use_debug_fission=true
+use_errorprone_java_compiler=false
+use_gnome_keyring=false
+use_official_google_api_keys=false
+use_rtti=false
+use_sysroot=false
+webview_includes_weblayer=false

+ 37 - 19
build/bromite_patches_list.txt

@@ -1,15 +1,12 @@
-Turn-AdBlock-off-by-default.patch
-Add-option-to-force-tablet-UI.patch
-Force-tablet-mode.patch
-Set-default-page-url.patch
-change-Android-userAgent-to-deskmode-userAgent.patch
-Force-accessibility-text-scaling.patch
-Force-package-name-to-org.chromium.chrome.patch
-Donot-stretch-when-force-enable-zoom-checked.patch
 Disable-third-party-cookies-by-default.patch
+do-not-hide-.orig-files.patch
+Do-not-link-with-libatomic.patch
+do-not-add-suffix-to-package-name.patch
+exit-on-failure-of-inclusion.patch
 AV1-codec-support.patch
 Switch-to-fstack-protector-strong.patch
 Enable-fwrapv-in-Clang-for-non-UBSan-builds.patch
+Bromite-package-name.patch
 Restore-classic-new-tab-page.patch
 Always-use-new-tab-page-for-default-home-page.patch
 Always-allow-partner-customisation.patch
@@ -25,7 +22,6 @@ Do-not-store-passwords-by-default.patch
 Disable-NTP-remote-suggestions-by-default.patch
 Disable-references-to-fonts.googleapis.com.patch
 Change-default-webRTC-policy-to-not-use-any-address.patch
-Never-send-any-crash-upload-data.patch
 Hide-send-reports-checkbox.patch
 Never-fetch-popular-sites.patch
 ungoogled-chromium-Disable-webRTC-log-uploader.patch
@@ -38,7 +34,7 @@ ungoogled-chromium-Disable-Gaia.patch
 ungoogled-chromium-Disable-domain-reliability.patch
 ungoogled-chromium-Disable-Network-Time-Tracker.patch
 Disable-safe-browsing.patch
-Skip-the-first-run-and-metrics.patch
+Skip-the-first-run-and-remove-report-sending.patch
 Disable-all-promo-dialogs.patch
 Remove-signin-and-data-saver-integrations.patch
 Hide-passwords-manager-link.patch
@@ -55,14 +51,12 @@ Add-exit-menu-item.patch
 Remove-help-menu-item.patch
 AudioBuffer-AnalyserNode-fp-mitigations.patch
 Multiple-fingerprinting-mitigations.patch
-Disable-metrics-on-all-I-O-threads.patch
 Add-flag-to-configure-maximum-connections-per-host.patch
 Do-not-ignore-download-location-prompt-setting.patch
 Add-bookmark-import-export-actions.patch
 Add-an-always-incognito-mode.patch
 Add-option-to-not-persist-tabs-across-sessions.patch
 Disable-fetching-of-all-field-trials.patch
-Disable-seed-based-field-trials.patch
 Disable-plugins-enumeration.patch
 net-cert-increase-default-key-length-for-newly-generated-RSA-keys.patch
 dns-send-IPv6-connectivity-probes-to-RIPE-DNS.patch
@@ -71,7 +65,7 @@ Do-not-build-API-keys-infobar.patch
 autofill-disable-autofill-download-manager.patch
 first_run-deactivate-autoupdate-globally.patch
 translate-disable-fetching-of-translate-languages-from-server.patch
-kill-TOS-and-metrics-opt-out.patch
+kill-TOS.patch
 kill-Vision.patch
 kill-Location-fall-back-to-system.patch
 kill-Auth.patch
@@ -80,16 +74,17 @@ Remove-SMS-integration.patch
 Do-not-compile-QR-code-sharing.patch
 Allow-website-sign-in-without-account-sign-in.patch
 Offer-builtin-autocomplete-for-chrome-flags.patch
-Disable-search-engine-DSE-automatic-permission.patch
 Add-flag-to-disable-IPv6-probes.patch
 Add-a-proxy-configuration-page.patch
 Use-4-tile-rows-never-show-logo.patch
+Disable-metrics-on-all-I-O-threads.patch
+Disable-various-metrics.patch
 Disable-metrics-collection-for-NTP-tiles.patch
 Enable-SPPI-for-devices-with-enough-memory.patch
 Use-64-bit-WebView-processes.patch
 prefs-disable-signinallowed-by-default.patch
 prefs-always-prompt-for-download-directory-by-default.patch
-Disable-offline-pages-in-the-downloads-home-to-be-opened-in-CCT-by-default.patch
+Disable-offline-pages-in-CCT.patch
 disable-payment-support-by-default.patch
 disable-background-sync-by-default.patch
 disable-sensors-access-site-setting-by-default.patch
@@ -98,8 +93,8 @@ Restore-Search-Ready-Omnibox-flag.patch
 disable-AdsBlockedInfoBar.patch
 Bromite-AdBlockUpdaterService.patch
 Replace-DoH-probe-domain-with-RIPE-domain.patch
-Increase-number-of-autocomplete-matches-from-5-to-10.patch
-Disable-HEAD-requests-for-single-word-Omnibar-searches.patch
+Increase-number-of-autocomplete-matches-to-10.patch
+Disable-requests-for-single-word-Omnibar-searches.patch
 Disable-some-signed-exchange-features.patch
 Add-flag-to-disable-WebGL.patch
 DoH-secure-mode-by-default.patch
@@ -130,6 +125,7 @@ Remove-weblayer-dependency-on-Play-Services.patch
 Timezone-customization.patch
 Move-some-account-settings-back-to-privacy-settings.patch
 Restore-Simplified-NTP-launch.patch
+Add-option-to-use-home-page-as-NTP.patch
 Revert-the-removal-of-an-option-to-block-autoplay.patch
 Disable-text-fragments-by-default.patch
 disable-WebView-variations-support.patch
@@ -141,12 +137,13 @@ Revert-flags-remove-num-raster-threads.patch
 webview-Hard-no-to-persistent-histograms.patch
 Ignore-enterprise-policies-for-secure-DNS.patch
 Add-menu-item-to-bookmark-all-tabs.patch
+Ask-user-before-closing-all-tabs.patch
 Add-flag-for-save-data-header.patch
+Add-option-to-force-tablet-UI.patch
 Make-all-favicon-requests-on-demand.patch
 Add-Alt-D-hotkey-to-focus-address-bar.patch
 Remove-offline-measurement-background-task.patch
 User-agent-customization.patch
-Force-desktop-mode.patch
 Add-AllowUserCertificates-flag.patch
 Add-IsCleartextPermitted-flag.patch
 Unexpire-tab-groups-flags.patch
@@ -159,7 +156,7 @@ JIT-less-toggle.patch
 API-level-21-prevent-crash-on-download.patch
 Add-flag-to-disable-vibration.patch
 mime_util-force-text-x-suse-ymp-to-be-downloaded.patch
-Override-UA-client-hint-for-model.patch
+Client-hints-overrides.patch
 Disable-AGSA-by-default.patch
 Allow-building-without-enable_reporting.patch
 Disable-lock-icon-in-address-bar-by-default.patch
@@ -171,5 +168,26 @@ Enable-native-Android-autofill.patch
 Keep-empty-tabs-between-sessions.patch
 Disable-third-party-origin-trials.patch
 Never-use-HTTP-probes-for-connection-detection.patch
+Disable-Accessibility-service-by-default.patch
+Disable-privacy-sandbox.patch
+Disable-conversion-measurement-api.patch
+Disable-FLoC.patch
+Restore-offline-indicator-v2-flag.patch
+Reintroduce-override_build_timestamp.patch
+enable-ftrivial-auto-var-init-zero.patch
+disable-appending-variations-header.patch
+Make-HTTPS-only-mode-the-default.patch
+disable-mobile-identity-consistency-by-default.patch
+Disable-idle-detection.patch
 Automated-domain-substitution.patch
+Allow-building-without-supervised-users.patch
+Turn-AdBlock-off-by-default.patch
+Force-tablet-mode.patch
+Set-default-page-url.patch
+change-Android-userAgent-to-deskmode-userAgent.patch
+Force-accessibility-text-scaling.patch
+Force-package-name-to-org.chromium.chrome.patch
+Donot-stretch-when-force-enable-zoom-checked.patch
+Force-desktop-mode.patch
 Telemetry-event-video-full-screen.patch
+

+ 44 - 0
build/chromium.gn_args

@@ -0,0 +1,44 @@
+android_channel="stable"
+blink_symbol_level=1
+chrome_pgo_phase=0
+dcheck_always_on=false
+debuggable_apks=false
+dfmify_dev_ui=false
+disable_android_lint=true
+disable_autofill_assistant_dfm=true
+disable_fieldtrial_testing_config=true
+disable_tab_ui_dfm=true
+enable_av1_decoder=true
+enable_dav1d_decoder=true
+enable_gvr_services=false
+enable_hangout_services_extension=false
+enable_iterator_debugging=false
+enable_mdns=false
+enable_mse_mpeg2ts_stream_parser=true
+enable_nacl=false
+enable_platform_dolby_vision=true
+enable_platform_hevc=true
+enable_remoting=false
+enable_reporting=true
+enable_vr=false
+exclude_unwind_tables=false
+ffmpeg_branding="Chrome"
+icu_use_data_file=true
+is_cfi=true
+is_component_build=false
+is_debug=false
+is_official_build=true
+proprietary_codecs=true
+rtc_build_examples=false
+safe_browsing_mode=2
+symbol_level=1
+system_webview_package_name="com.android.webview"
+target_os="android"
+use_cfi_cast = true
+use_debug_fission=true
+use_errorprone_java_compiler=false
+use_gnome_keyring=false
+use_official_google_api_keys=false
+use_rtti=false
+use_sysroot=false
+webview_includes_weblayer=false

+ 7 - 0
build/chromium_patches_list.txt

@@ -1,4 +1,11 @@
 AV1-codec-support.patch
+exit-on-failure-of-inclusion.patch
+Reintroduce-override_build_timestamp.patch
+do-not-hide-.orig-files.patch
+Do-not-link-with-libatomic.patch
+do-not-add-suffix-to-package-name.patch
 Switch-to-fstack-protector-strong.patch
 Enable-fwrapv-in-Clang-for-non-UBSan-builds.patch
+enable-ftrivial-auto-var-init-zero.patch
 Disable-feeds-support-by-default.patch
+Chromium-package-name.patch

+ 24 - 21
build/patches/AImageReader-CFI-crash-mitigations.patch

@@ -20,7 +20,7 @@ See discussions at:
 ---
  base/android/android_image_reader_compat.cc |  8 +++++++-
  base/android/android_image_reader_compat.h  |  4 ++++
- chrome/browser/flag-metadata.json           |  2 +-
+ chrome/browser/flag-metadata.json           |  6 +++---
  gpu/config/gpu_driver_bug_list.json         | 16 ++++++++++++++++
  gpu/config/gpu_finch_features.cc            |  5 +++++
  gpu/config/gpu_finch_features.h             |  1 +
@@ -30,7 +30,7 @@ See discussions at:
  gpu/ipc/service/stream_texture_android.cc   | 11 ++++++++++-
  media/base/media_switches.cc                |  4 ++++
  media/base/media_switches.h                 |  1 +
- 12 files changed, 63 insertions(+), 3 deletions(-)
+ 12 files changed, 65 insertions(+), 5 deletions(-)
 
 diff --git a/base/android/android_image_reader_compat.cc b/base/android/android_image_reader_compat.cc
 --- a/base/android/android_image_reader_compat.cc
@@ -61,9 +61,9 @@ diff --git a/base/android/android_image_reader_compat.cc b/base/android/android_
 diff --git a/base/android/android_image_reader_compat.h b/base/android/android_image_reader_compat.h
 --- a/base/android/android_image_reader_compat.h
 +++ b/base/android/android_image_reader_compat.h
-@@ -22,6 +22,9 @@ class BASE_EXPORT AndroidImageReader {
-   // Thread safe GetInstance.
-   static AndroidImageReader& GetInstance();
+@@ -24,6 +24,9 @@ class BASE_EXPORT AndroidImageReader {
+   AndroidImageReader(const AndroidImageReader&) = delete;
+   AndroidImageReader& operator=(const AndroidImageReader&) = delete;
  
 +  // Disable image reader support.
 +  static void DisableSupport();
@@ -71,7 +71,7 @@ diff --git a/base/android/android_image_reader_compat.h b/base/android/android_i
    // Check if the image reader usage is supported. This function returns TRUE
    // if android version is >=OREO, image reader support is not disabled and all
    // the required functions are loaded.
-@@ -59,6 +62,7 @@ class BASE_EXPORT AndroidImageReader {
+@@ -61,6 +64,7 @@ class BASE_EXPORT AndroidImageReader {
    jobject ANativeWindow_toSurface(JNIEnv* env, ANativeWindow* window);
  
   private:
@@ -82,11 +82,15 @@ diff --git a/base/android/android_image_reader_compat.h b/base/android/android_i
 diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json
 --- a/chrome/browser/flag-metadata.json
 +++ b/chrome/browser/flag-metadata.json
-@@ -2101,7 +2101,7 @@
+@@ -2144,9 +2144,9 @@
+     "expiry_milestone": 100
+   },
    {
-     "name": "enable-image-reader",
-     "owners": [ "vikassoni", "liberato" ],
--    "expiry_milestone": 95
+-    "name": "enable-image-reader",
+-    "owners": [ "vikassoni", "liberato" ],
+-    "expiry_milestone": 115
++    "name": "enable-image-reader",          // Bromite: do not expire
++    "owners": [ "vikassoni", "liberato" ],  // flag
 +    "expiry_milestone": -1
    },
    {
@@ -120,7 +124,7 @@ diff --git a/gpu/config/gpu_driver_bug_list.json b/gpu/config/gpu_driver_bug_lis
 diff --git a/gpu/config/gpu_finch_features.cc b/gpu/config/gpu_finch_features.cc
 --- a/gpu/config/gpu_finch_features.cc
 +++ b/gpu/config/gpu_finch_features.cc
-@@ -51,6 +51,11 @@ bool IsDeviceBlocked(const char* field, const std::string& block_list) {
+@@ -52,6 +52,11 @@ bool IsDeviceBlocked(const char* field, const std::string& block_list) {
  }  // namespace
  
  #if defined(OS_ANDROID)
@@ -156,7 +160,7 @@ diff --git a/gpu/config/gpu_util.cc b/gpu/config/gpu_util.cc
    if (!gpu_preferences.enable_android_surface_control)
      return kGpuFeatureStatusDisabled;
  
-@@ -344,6 +347,11 @@ void AdjustGpuFeatureStatusToWorkarounds(GpuFeatureInfo* gpu_feature_info) {
+@@ -356,6 +359,11 @@ void AdjustGpuFeatureStatusToWorkarounds(GpuFeatureInfo* gpu_feature_info) {
      gpu_feature_info->status_values[GPU_FEATURE_TYPE_CANVAS_OOP_RASTERIZATION] =
          kGpuFeatureStatusBlocklisted;
    }
@@ -171,18 +175,18 @@ diff --git a/gpu/config/gpu_util.cc b/gpu/config/gpu_util.cc
 diff --git a/gpu/config/gpu_workaround_list.txt b/gpu/config/gpu_workaround_list.txt
 --- a/gpu/config/gpu_workaround_list.txt
 +++ b/gpu/config/gpu_workaround_list.txt
-@@ -13,6 +13,7 @@ decode_encode_srgb_for_generatemipmap
+@@ -14,6 +14,7 @@ decode_encode_srgb_for_generatemipmap
  depth_stencil_renderbuffer_resize_emulation
  disable_2d_canvas_auto_flush
  disable_accelerated_av1_decode
 +disable_aimagereader
- disable_accelerated_av1_decode_d3d11
  disable_accelerated_h264_encode
  disable_accelerated_vp8_decode
+ disable_accelerated_vp8_encode
 diff --git a/gpu/ipc/service/gpu_init.cc b/gpu/ipc/service/gpu_init.cc
 --- a/gpu/ipc/service/gpu_init.cc
 +++ b/gpu/ipc/service/gpu_init.cc
-@@ -517,6 +517,11 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line,
+@@ -518,6 +518,11 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line,
      }
    }
  
@@ -205,7 +209,7 @@ diff --git a/gpu/ipc/service/stream_texture_android.cc b/gpu/ipc/service/stream_
  #include "base/android/scoped_hardware_buffer_fence_sync.h"
  #include "base/bind.h"
  #include "base/feature_list.h"
-@@ -50,7 +51,15 @@ std::unique_ptr<ui::ScopedMakeCurrent> MakeCurrent(
+@@ -51,7 +52,15 @@ std::unique_ptr<ui::ScopedMakeCurrent> MakeCurrent(
  }
  
  TextureOwner::Mode GetTextureOwnerMode() {
@@ -225,7 +229,7 @@ diff --git a/gpu/ipc/service/stream_texture_android.cc b/gpu/ipc/service/stream_
 diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc
 --- a/media/base/media_switches.cc
 +++ b/media/base/media_switches.cc
-@@ -653,6 +653,10 @@ const base::Feature kMediaDrmPreprovisioning{"MediaDrmPreprovisioning",
+@@ -663,6 +663,10 @@ const base::Feature kMediaDrmPreprovisioning{"MediaDrmPreprovisioning",
  // Note: Has no effect if kMediaDrmPreprovisioning feature is disabled.
  const base::Feature kMediaDrmPreprovisioningAtStartup{
      "MediaDrmPreprovisioningAtStartup", base::FEATURE_ENABLED_BY_DEFAULT};
@@ -239,7 +243,7 @@ diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc
 diff --git a/media/base/media_switches.h b/media/base/media_switches.h
 --- a/media/base/media_switches.h
 +++ b/media/base/media_switches.h
-@@ -216,6 +216,7 @@ MEDIA_EXPORT extern const base::Feature kForceHardwareAudioDecoders;
+@@ -212,6 +212,7 @@ MEDIA_EXPORT extern const base::Feature kForceHardwareAudioDecoders;
  MEDIA_EXPORT extern const base::Feature kAllowNonSecureOverlays;
  MEDIA_EXPORT extern const base::Feature kMediaControlsExpandGesture;
  MEDIA_EXPORT extern const base::Feature kMediaDrmPersistentLicense;
@@ -247,6 +251,5 @@ diff --git a/media/base/media_switches.h b/media/base/media_switches.h
  MEDIA_EXPORT extern const base::Feature kMediaDrmPreprovisioning;
  MEDIA_EXPORT extern const base::Feature kMediaDrmPreprovisioningAtStartup;
  MEDIA_EXPORT extern const base::Feature kCanPlayHls;
--- 
-2.20.1
-
+--
+2.25.1

+ 2 - 3
build/patches/API-level-21-prevent-crash-on-download.patch

@@ -33,6 +33,5 @@ diff --git a/components/background_task_scheduler/internal/android/java/src/org/
              } else if (obj instanceof Double) {
                  persistableBundle.putDouble(key, (Double) obj);
              } else if (obj instanceof double[]) {
--- 
-2.20.1
-
+--
+2.25.1

+ 17 - 18
build/patches/AV1-codec-support.patch

@@ -33,7 +33,7 @@ diff --git a/third_party/libaom/BUILD.gn b/third_party/libaom/BUILD.gn
        include_dirs = libaom_include_dirs
      }
  
-@@ -193,7 +193,7 @@ if (enable_libaom) {
+@@ -194,7 +194,7 @@ if (enable_libaom) {
        configs += [ "//build/config/compiler:no_chromium_code" ]
        if (current_cpu == "arm") {
          configs -= [ "//build/config/compiler:compiler_arm_fpu" ]
@@ -42,7 +42,7 @@ diff --git a/third_party/libaom/BUILD.gn b/third_party/libaom/BUILD.gn
        }
        configs += [ ":libaom_config" ]
  
-@@ -256,6 +256,8 @@ if (enable_libaom) {
+@@ -257,6 +257,8 @@ if (enable_libaom) {
      if (current_cpu == "arm64" || cpu_arch_full == "arm-neon" ||
          cpu_arch_full == "arm-neon-cpu-detect") {
        deps += [ ":libaom_intrinsics_neon" ]
@@ -54,7 +54,7 @@ diff --git a/third_party/libaom/BUILD.gn b/third_party/libaom/BUILD.gn
 diff --git a/third_party/libaom/libaom_srcs.gni b/third_party/libaom/libaom_srcs.gni
 --- a/third_party/libaom/libaom_srcs.gni
 +++ b/third_party/libaom/libaom_srcs.gni
-@@ -634,6 +634,11 @@ aom_mem_sources = [
+@@ -643,6 +643,11 @@ aom_mem_sources = [
  
  aom_ports_asm_x86 = [ "//third_party/libaom/source/libaom/aom_ports/float.asm" ]
  
@@ -69,7 +69,7 @@ diff --git a/third_party/libaom/libaom_srcs.gni b/third_party/libaom/libaom_srcs
 diff --git a/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.asm b/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.asm
 --- a/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.asm
 +++ b/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.asm
-@@ -48,7 +48,7 @@ CONFIG_NORMAL_TILE_MODE equ 1
+@@ -50,7 +50,7 @@ CONFIG_NORMAL_TILE_MODE equ 1
  CONFIG_OPTICAL_FLOW_API equ 0
  CONFIG_OS_SUPPORT equ 1
  CONFIG_PARTITION_SEARCH_ORDER equ 0
@@ -81,7 +81,7 @@ diff --git a/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/a
 diff --git a/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.h b/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.h
 --- a/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.h
 +++ b/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/aom_config.h
-@@ -50,7 +50,7 @@
+@@ -52,7 +52,7 @@
  #define CONFIG_OPTICAL_FLOW_API 0
  #define CONFIG_OS_SUPPORT 1
  #define CONFIG_PARTITION_SEARCH_ORDER 0
@@ -93,7 +93,7 @@ diff --git a/third_party/libaom/source/config/linux/arm-neon-cpu-detect/config/a
 diff --git a/third_party/libaom/source/config/linux/arm-neon/config/aom_config.asm b/third_party/libaom/source/config/linux/arm-neon/config/aom_config.asm
 --- a/third_party/libaom/source/config/linux/arm-neon/config/aom_config.asm
 +++ b/third_party/libaom/source/config/linux/arm-neon/config/aom_config.asm
-@@ -48,7 +48,7 @@ CONFIG_NORMAL_TILE_MODE equ 1
+@@ -50,7 +50,7 @@ CONFIG_NORMAL_TILE_MODE equ 1
  CONFIG_OPTICAL_FLOW_API equ 0
  CONFIG_OS_SUPPORT equ 1
  CONFIG_PARTITION_SEARCH_ORDER equ 0
@@ -105,7 +105,7 @@ diff --git a/third_party/libaom/source/config/linux/arm-neon/config/aom_config.a
 diff --git a/third_party/libaom/source/config/linux/arm-neon/config/aom_config.h b/third_party/libaom/source/config/linux/arm-neon/config/aom_config.h
 --- a/third_party/libaom/source/config/linux/arm-neon/config/aom_config.h
 +++ b/third_party/libaom/source/config/linux/arm-neon/config/aom_config.h
-@@ -50,7 +50,7 @@
+@@ -52,7 +52,7 @@
  #define CONFIG_OPTICAL_FLOW_API 0
  #define CONFIG_OS_SUPPORT 1
  #define CONFIG_PARTITION_SEARCH_ORDER 0
@@ -117,7 +117,7 @@ diff --git a/third_party/libaom/source/config/linux/arm-neon/config/aom_config.h
 diff --git a/third_party/libaom/source/config/linux/arm/config/aom_config.asm b/third_party/libaom/source/config/linux/arm/config/aom_config.asm
 --- a/third_party/libaom/source/config/linux/arm/config/aom_config.asm
 +++ b/third_party/libaom/source/config/linux/arm/config/aom_config.asm
-@@ -48,7 +48,7 @@ CONFIG_NORMAL_TILE_MODE equ 1
+@@ -50,7 +50,7 @@ CONFIG_NORMAL_TILE_MODE equ 1
  CONFIG_OPTICAL_FLOW_API equ 0
  CONFIG_OS_SUPPORT equ 1
  CONFIG_PARTITION_SEARCH_ORDER equ 0
@@ -129,7 +129,7 @@ diff --git a/third_party/libaom/source/config/linux/arm/config/aom_config.asm b/
 diff --git a/third_party/libaom/source/config/linux/arm/config/aom_config.h b/third_party/libaom/source/config/linux/arm/config/aom_config.h
 --- a/third_party/libaom/source/config/linux/arm/config/aom_config.h
 +++ b/third_party/libaom/source/config/linux/arm/config/aom_config.h
-@@ -50,7 +50,7 @@
+@@ -52,7 +52,7 @@
  #define CONFIG_OPTICAL_FLOW_API 0
  #define CONFIG_OS_SUPPORT 1
  #define CONFIG_PARTITION_SEARCH_ORDER 0
@@ -141,7 +141,7 @@ diff --git a/third_party/libaom/source/config/linux/arm/config/aom_config.h b/th
 diff --git a/third_party/libaom/source/config/linux/arm64/config/aom_config.asm b/third_party/libaom/source/config/linux/arm64/config/aom_config.asm
 --- a/third_party/libaom/source/config/linux/arm64/config/aom_config.asm
 +++ b/third_party/libaom/source/config/linux/arm64/config/aom_config.asm
-@@ -48,7 +48,7 @@ CONFIG_NORMAL_TILE_MODE equ 1
+@@ -50,7 +50,7 @@ CONFIG_NORMAL_TILE_MODE equ 1
  CONFIG_OPTICAL_FLOW_API equ 0
  CONFIG_OS_SUPPORT equ 1
  CONFIG_PARTITION_SEARCH_ORDER equ 0
@@ -153,7 +153,7 @@ diff --git a/third_party/libaom/source/config/linux/arm64/config/aom_config.asm
 diff --git a/third_party/libaom/source/config/linux/arm64/config/aom_config.h b/third_party/libaom/source/config/linux/arm64/config/aom_config.h
 --- a/third_party/libaom/source/config/linux/arm64/config/aom_config.h
 +++ b/third_party/libaom/source/config/linux/arm64/config/aom_config.h
-@@ -50,7 +50,7 @@
+@@ -52,7 +52,7 @@
  #define CONFIG_OPTICAL_FLOW_API 0
  #define CONFIG_OS_SUPPORT 1
  #define CONFIG_PARTITION_SEARCH_ORDER 0
@@ -165,7 +165,7 @@ diff --git a/third_party/libaom/source/config/linux/arm64/config/aom_config.h b/
 diff --git a/third_party/libaom/source/config/linux/generic/config/aom_config.asm b/third_party/libaom/source/config/linux/generic/config/aom_config.asm
 --- a/third_party/libaom/source/config/linux/generic/config/aom_config.asm
 +++ b/third_party/libaom/source/config/linux/generic/config/aom_config.asm
-@@ -48,7 +48,7 @@ CONFIG_NORMAL_TILE_MODE equ 1
+@@ -50,7 +50,7 @@ CONFIG_NORMAL_TILE_MODE equ 1
  CONFIG_OPTICAL_FLOW_API equ 0
  CONFIG_OS_SUPPORT equ 1
  CONFIG_PARTITION_SEARCH_ORDER equ 0
@@ -177,7 +177,7 @@ diff --git a/third_party/libaom/source/config/linux/generic/config/aom_config.as
 diff --git a/third_party/libaom/source/config/linux/generic/config/aom_config.h b/third_party/libaom/source/config/linux/generic/config/aom_config.h
 --- a/third_party/libaom/source/config/linux/generic/config/aom_config.h
 +++ b/third_party/libaom/source/config/linux/generic/config/aom_config.h
-@@ -50,7 +50,7 @@
+@@ -52,7 +52,7 @@
  #define CONFIG_OPTICAL_FLOW_API 0
  #define CONFIG_OS_SUPPORT 1
  #define CONFIG_PARTITION_SEARCH_ORDER 0
@@ -189,7 +189,7 @@ diff --git a/third_party/libaom/source/config/linux/generic/config/aom_config.h
 diff --git a/third_party/libaom/source/config/linux/x64/config/aom_config.asm b/third_party/libaom/source/config/linux/x64/config/aom_config.asm
 --- a/third_party/libaom/source/config/linux/x64/config/aom_config.asm
 +++ b/third_party/libaom/source/config/linux/x64/config/aom_config.asm
-@@ -38,7 +38,7 @@
+@@ -40,7 +40,7 @@
  %define CONFIG_OPTICAL_FLOW_API 0
  %define CONFIG_OS_SUPPORT 1
  %define CONFIG_PARTITION_SEARCH_ORDER 0
@@ -201,7 +201,7 @@ diff --git a/third_party/libaom/source/config/linux/x64/config/aom_config.asm b/
 diff --git a/third_party/libaom/source/config/linux/x64/config/aom_config.h b/third_party/libaom/source/config/linux/x64/config/aom_config.h
 --- a/third_party/libaom/source/config/linux/x64/config/aom_config.h
 +++ b/third_party/libaom/source/config/linux/x64/config/aom_config.h
-@@ -50,7 +50,7 @@
+@@ -52,7 +52,7 @@
  #define CONFIG_OPTICAL_FLOW_API 0
  #define CONFIG_OS_SUPPORT 1
  #define CONFIG_PARTITION_SEARCH_ORDER 0
@@ -210,6 +210,5 @@ diff --git a/third_party/libaom/source/config/linux/x64/config/aom_config.h b/th
  #define CONFIG_RD_COMMAND 0
  #define CONFIG_RD_DEBUG 0
  #define CONFIG_REALTIME_ONLY 1
--- 
-2.20.1
-
+--
+2.25.1

+ 9 - 10
build/patches/Add-AllowUserCertificates-flag.patch

@@ -18,7 +18,7 @@ Subject: Add AllowUserCertificates flag
 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
 --- a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
 +++ b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
-@@ -226,6 +226,7 @@ import org.chromium.content_public.browser.ScreenOrientationProvider;
+@@ -230,6 +230,7 @@ import org.chromium.content_public.browser.ScreenOrientationProvider;
  import org.chromium.content_public.browser.SelectionPopupController;
  import org.chromium.content_public.browser.WebContents;
  import org.chromium.content_public.common.ContentSwitches;
@@ -26,7 +26,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActiv
  import org.chromium.printing.PrintManagerDelegateImpl;
  import org.chromium.printing.PrintingController;
  import org.chromium.printing.PrintingControllerImpl;
-@@ -984,6 +985,8 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
+@@ -992,6 +993,8 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
          UpdateMenuItemHelper.getInstance().onStart();
          ChromeActivitySessionTracker.getInstance().onStartWithNative();
          ChromeCachedFlags.getInstance().cacheNativeFlags();
@@ -38,9 +38,9 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActiv
 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/flags/ChromeCachedFlags.java b/chrome/android/java/src/org/chromium/chrome/browser/app/flags/ChromeCachedFlags.java
 --- a/chrome/android/java/src/org/chromium/chrome/browser/app/flags/ChromeCachedFlags.java
 +++ b/chrome/android/java/src/org/chromium/chrome/browser/app/flags/ChromeCachedFlags.java
-@@ -87,6 +87,7 @@ public class ChromeCachedFlags {
-                 add(ChromeFeatureList.EARLY_LIBRARY_LOAD);
-                 add(ChromeFeatureList.ELASTIC_OVERSCROLL);
+@@ -92,6 +92,7 @@ public class ChromeCachedFlags {
+                                 .GIVE_JAVA_UI_THREAD_DEFAULT_TASK_TRAITS_USER_BLOCKING_PRIORITY);
+                 add(ChromeFeatureList.GRID_TAB_SWITCHER_FOR_TABLETS);
                  add(ChromeFeatureList.IMMERSIVE_UI_MODE);
 +                add(ChromeFeatureList.ALLOW_USER_CERTIFICATES);
                  add(ChromeFeatureList.INSTANT_START);
@@ -49,7 +49,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/flags/Chrom
 diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
 --- a/chrome/browser/about_flags.cc
 +++ b/chrome/browser/about_flags.cc
-@@ -2910,6 +2910,10 @@ const FeatureEntry kFeatureEntries[] = {
+@@ -2787,6 +2787,10 @@ const FeatureEntry kFeatureEntries[] = {
       flag_descriptions::kCSSContainerQueriesDescription, kOsAll,
       FEATURE_VALUE_TYPE(blink::features::kCSSContainerQueries)},
  #if defined(OS_ANDROID)
@@ -99,7 +99,7 @@ diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browse
      &feed::kInterestFeedV1ClicksAndViewsConditionalUpload,
      &feed::kInterestFeedV2,
      &feed::kInterestFeedV2Autoplay,
-@@ -377,6 +378,9 @@ const base::Feature kAdaptiveButtonInTopToolbarCustomizationV2{
+@@ -385,6 +386,9 @@ const base::Feature kAdaptiveButtonInTopToolbarCustomizationV2{
      "AdaptiveButtonInTopToolbarCustomizationV2",
      base::FEATURE_DISABLED_BY_DEFAULT};
  
@@ -164,6 +164,5 @@ diff --git a/net/android/java/src/org/chromium/net/X509Util.java b/net/android/j
              return new AndroidCertVerifyResult(CertVerifyStatusAndroid.OK,
                                                 isIssuedByKnownRoot, verifiedChain);
          }
--- 
-2.20.1
-
+--
+2.25.1

+ 2 - 3
build/patches/Add-Alt-D-hotkey-to-focus-address-bar.patch

@@ -18,6 +18,5 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/KeyboardShortcu
          shortcutGroups.add(chromeFeatureShortcutGroup);
  
          KeyboardShortcutGroup webpageShortcutGroup = new KeyboardShortcutGroup(
--- 
-2.20.1
-
+--
+2.25.1

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 197 - 169
build/patches/Add-DuckDuckGo-Lite-search-engine.patch


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 145 - 146
build/patches/Add-English-only-search-engine.patch


+ 16 - 17
build/patches/Add-IsCleartextPermitted-flag.patch

@@ -14,22 +14,22 @@ Subject: Add IsCleartextPermitted flag
 diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
 --- a/chrome/browser/about_flags.cc
 +++ b/chrome/browser/about_flags.cc
-@@ -7852,6 +7852,11 @@ const FeatureEntry kFeatureEntries[] = {
-      FEATURE_VALUE_TYPE(
-          chrome::android::kBookmarksExportUseSaf)},
+@@ -7741,6 +7741,11 @@ const FeatureEntry kFeatureEntries[] = {
+      SINGLE_VALUE_TYPE(switches::kPervasiveSystemAccentColor)},
+ #endif
  
 +    {"cleartext-permitted",
 +     flag_descriptions::kIsCleartextPermittedName,
 +     flag_descriptions::kIsCleartextPermittedDescription, kOsAndroid,
 +     FEATURE_VALUE_TYPE(net::features::kIsCleartextPermitted)},
 +
-     // NOTE: Adding a new flag requires adding a corresponding entry to enum
-     // "LoginCustomFlags" in tools/metrics/histograms/enums.xml. See "Flag
-     // Histograms" in tools/metrics/histograms/README.md (run the
+ #if defined(OS_ANDROID)
+     {"use-ulp-languages-in-chrome",
+      flag_descriptions::kUseULPLanguagesInChromeName,
 diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
 --- a/chrome/browser/flag_descriptions.cc
 +++ b/chrome/browser/flag_descriptions.cc
-@@ -1460,6 +1460,10 @@ const char kHttpsOnlyModeDescription[] =
+@@ -1484,6 +1484,10 @@ const char kHttpsOnlyModeDescription[] =
      "Adds a setting under chrome://settings/security to opt-in to HTTPS-First "
      "Mode.";
  
@@ -43,7 +43,7 @@ diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descripti
 diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
 --- a/chrome/browser/flag_descriptions.h
 +++ b/chrome/browser/flag_descriptions.h
-@@ -845,6 +845,9 @@ extern const char kHostedAppShimCreationDescription[];
+@@ -862,6 +862,9 @@ extern const char kHideShelfControlsInTabletModeDescription[];
  extern const char kHttpsOnlyModeName[];
  extern const char kHttpsOnlyModeDescription[];
  
@@ -56,8 +56,8 @@ diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptio
 diff --git a/net/base/features.cc b/net/base/features.cc
 --- a/net/base/features.cc
 +++ b/net/base/features.cc
-@@ -89,6 +89,9 @@ const base::FeatureParam<int> kUseDnsHttpsSvcbExtraTimePercent{
- const base::Feature kEnableTLS13EarlyData{"EnableTLS13EarlyData",
+@@ -92,6 +92,9 @@ const base::Feature kEnableTLS13EarlyData{"EnableTLS13EarlyData",
+ const base::Feature kEncryptedClientHello{"EncryptedClientHello",
                                            base::FEATURE_DISABLED_BY_DEFAULT};
  
 +const base::Feature kIsCleartextPermitted{"IsCleartextPermitted",
@@ -69,9 +69,9 @@ diff --git a/net/base/features.cc b/net/base/features.cc
 diff --git a/net/base/features.h b/net/base/features.h
 --- a/net/base/features.h
 +++ b/net/base/features.h
-@@ -37,6 +37,8 @@ NET_EXPORT extern const base::Feature kCapReferrerToOriginOnCrossOrigin;
- // Enables TLS 1.3 early data.
- NET_EXPORT extern const base::Feature kEnableTLS13EarlyData;
+@@ -34,6 +34,8 @@ NET_EXPORT extern const base::Feature kAvoidH2Reprioritization;
+ // origin requests are restricted to contain at most the source origin.
+ NET_EXPORT extern const base::Feature kCapReferrerToOriginOnCrossOrigin;
  
 +NET_EXPORT extern const base::Feature kIsCleartextPermitted;
 +
@@ -81,7 +81,7 @@ diff --git a/net/base/features.h b/net/base/features.h
 diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_request_http_job.cc
 --- a/net/url_request/url_request_http_job.cc
 +++ b/net/url_request/url_request_http_job.cc
-@@ -215,6 +215,10 @@ std::unique_ptr<URLRequestJob> URLRequestHttpJob::Create(URLRequest* request) {
+@@ -206,6 +206,10 @@ std::unique_ptr<URLRequestJob> URLRequestHttpJob::Create(URLRequest* request) {
      }
  
  #if defined(OS_ANDROID)
@@ -92,6 +92,5 @@ diff --git a/net/url_request/url_request_http_job.cc b/net/url_request/url_reque
      // Check whether the app allows cleartext traffic to this host, and return
      // ERR_CLEARTEXT_NOT_PERMITTED if not.
      if (request->context()->check_cleartext_permitted() &&
--- 
-2.20.1
-
+--
+2.25.1

+ 7 - 8
build/patches/Add-a-flag-to-allow-screenshots-in-Incognito-mode.patch

@@ -17,7 +17,7 @@ See also:
 diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
 --- a/chrome/browser/about_flags.cc
 +++ b/chrome/browser/about_flags.cc
-@@ -7709,6 +7709,12 @@ const FeatureEntry kFeatureEntries[] = {
+@@ -7403,6 +7403,12 @@ const FeatureEntry kFeatureEntries[] = {
                                      "AndroidDynamicColor")},
  #endif  //   defined(OS_ANDROID)
  
@@ -33,7 +33,7 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
 diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
 --- a/chrome/browser/flag_descriptions.cc
 +++ b/chrome/browser/flag_descriptions.cc
-@@ -658,6 +658,11 @@ const char kEnableAutofillCreditCardAuthenticationDescription[] =
+@@ -692,6 +692,11 @@ const char kEnableAutofillCreditCardAuthenticationDescription[] =
      "authenticator (if available) to verify card ownership when retrieving "
      "credit cards from Google Payments.";
  
@@ -48,7 +48,7 @@ diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descripti
 diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
 --- a/chrome/browser/flag_descriptions.h
 +++ b/chrome/browser/flag_descriptions.h
-@@ -420,6 +420,9 @@ extern const char kEnableAutofillSaveCardInfoBarAccountIndicationFooterName[];
+@@ -440,6 +440,9 @@ extern const char kEnableAutofillSaveCardInfoBarAccountIndicationFooterName[];
  extern const char
      kEnableAutofillSaveCardInfoBarAccountIndicationFooterDescription[];
  
@@ -75,7 +75,7 @@ diff --git a/chrome/browser/flags/android/java_templates/ChromeSwitches.java.tmp
 diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
 --- a/chrome/common/chrome_switches.cc
 +++ b/chrome/common/chrome_switches.cc
-@@ -344,6 +344,9 @@ const char kHomePage[]                      = "homepage";
+@@ -332,6 +332,9 @@ const char kHomePage[]                      = "homepage";
  // Causes the browser to launch directly in incognito mode.
  const char kIncognito[]                     = "incognito";
  
@@ -88,7 +88,7 @@ diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
 diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
 --- a/chrome/common/chrome_switches.h
 +++ b/chrome/common/chrome_switches.h
-@@ -114,6 +114,7 @@ extern const char kForceStackedTabStripLayout[];
+@@ -109,6 +109,7 @@ extern const char kForceFirstRun[];
  extern const char kHideCrashRestoreBubble[];
  extern const char kHomePage[];
  extern const char kIncognito[];
@@ -96,6 +96,5 @@ diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
  extern const char kInstallAutogeneratedTheme[];
  extern const char kInstallChromeApp[];
  extern const char kInstantProcess[];
--- 
-2.20.1
-
+--
+2.25.1

+ 52 - 56
build/patches/Add-a-proxy-configuration-page.patch

@@ -23,8 +23,8 @@ for SimpleURLLoaders as well.
  chrome/browser/resources/proxy_config.js      | 266 +++++++++++
  chrome/browser/ui/BUILD.gn                    |   2 +
  .../webui/chrome_web_ui_controller_factory.cc |   3 +
- chrome/browser/ui/webui/proxy_config_ui.cc    | 419 ++++++++++++++++++
- chrome/browser/ui/webui/proxy_config_ui.h     |  33 ++
+ chrome/browser/ui/webui/proxy_config_ui.cc    | 418 ++++++++++++++++++
+ chrome/browser/ui/webui/proxy_config_ui.h     |  31 ++
  chrome/common/webui_url_constants.cc          |   4 +
  chrome/common/webui_url_constants.h           |   2 +
  .../pref_proxy_config_tracker_impl.cc         |   1 +
@@ -33,7 +33,7 @@ for SimpleURLLoaders as well.
  .../proxy_config/proxy_policy_handler.cc      |   2 +-
  net/proxy_resolution/proxy_config.cc          |  52 ++-
  net/proxy_resolution/proxy_config.h           |   3 +
- 24 files changed, 998 insertions(+), 14 deletions(-)
+ 24 files changed, 995 insertions(+), 14 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
@@ -70,7 +70,7 @@ diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/androi
 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
 --- a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
 +++ b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
-@@ -49,6 +49,7 @@ import org.chromium.ui.text.SpanApplier;
+@@ -52,6 +52,7 @@ import org.chromium.ui.text.SpanApplier;
  public class PrivacySettings
          extends PreferenceFragmentCompat implements Preference.OnPreferenceChangeListener,
                                                      INeedSnackbarManager {
@@ -81,7 +81,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting
 diff --git a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc
 --- a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc
 +++ b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc
-@@ -367,6 +367,8 @@ ChromeAutocompleteProviderClient::GetBuiltinsToProvideAsUserTypes() {
+@@ -280,6 +280,8 @@ ChromeAutocompleteProviderClient::GetBuiltinsToProvideAsUserTypes() {
    builtins_to_provide.push_back(
        base::ASCIIToUTF16(chrome::kChromeUISettingsURL));
  #endif
@@ -119,7 +119,7 @@ diff --git a/chrome/browser/net/proxy_service_factory.cc b/chrome/browser/net/pr
  
  #if BUILDFLAG(IS_CHROMEOS_ASH)
  #include "chromeos/network/proxy/proxy_config_service_impl.h"
-@@ -59,7 +62,20 @@ ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile(
+@@ -73,7 +76,20 @@ ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile(
    return std::make_unique<chromeos::ProxyConfigServiceImpl>(
        profile_prefs, local_state_prefs, nullptr);
  #else
@@ -141,7 +141,7 @@ diff --git a/chrome/browser/net/proxy_service_factory.cc b/chrome/browser/net/pr
  #endif  // BUILDFLAG(IS_CHROMEOS_ASH)
  }
  
-@@ -75,3 +91,8 @@ ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState(
+@@ -89,3 +105,8 @@ ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState(
                                                        nullptr);
  #endif  // BUILDFLAG(IS_CHROMEOS_ASH)
  }
@@ -156,24 +156,24 @@ diff --git a/chrome/browser/net/proxy_service_factory.h b/chrome/browser/net/pro
 @@ -8,6 +8,7 @@
  #include <memory>
  
- #include "base/macros.h"
-+#include "components/prefs/pref_registry_simple.h"
- 
  class PrefProxyConfigTracker;
++#include "components/prefs/pref_registry_simple.h"
  class PrefService;
-@@ -37,6 +38,8 @@ class ProxyServiceFactory {
-   static std::unique_ptr<PrefProxyConfigTracker>
-   CreatePrefProxyConfigTrackerOfLocalState(PrefService* local_state_prefs);
+ class Profile;
+ 
+@@ -35,6 +36,8 @@ class ProxyServiceFactory {
+   CreatePrefProxyConfigTrackerOfProfile(PrefService* profile_prefs,
+                                         PrefService* local_state_prefs);
  
 +  static void RegisterPrefs(PrefRegistrySimple* registry);
 +
-  private:
-   DISALLOW_IMPLICIT_CONSTRUCTORS(ProxyServiceFactory);
- };
+   // Creates a PrefProxyConfigTracker that tracks local state only. This tracker
+   // should be used for the system request context and the signin screen
+   // (ChromeOS only).
 diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
 --- a/chrome/browser/prefs/browser_prefs.cc
 +++ b/chrome/browser/prefs/browser_prefs.cc
-@@ -160,6 +160,8 @@
+@@ -159,6 +159,8 @@
  #include "printing/buildflags/buildflags.h"
  #include "rlz/buildflags/buildflags.h"
  
@@ -182,7 +182,7 @@ diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browse
  #if BUILDFLAG(ENABLE_BACKGROUND_MODE)
  #include "chrome/browser/background/background_mode_manager.h"
  #endif
-@@ -941,6 +943,8 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
+@@ -962,6 +964,8 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
    PluginsResourceService::RegisterPrefs(registry);
  #endif
  
@@ -194,7 +194,7 @@ diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browse
 diff --git a/chrome/browser/prefs/chrome_command_line_pref_store.cc b/chrome/browser/prefs/chrome_command_line_pref_store.cc
 --- a/chrome/browser/prefs/chrome_command_line_pref_store.cc
 +++ b/chrome/browser/prefs/chrome_command_line_pref_store.cc
-@@ -157,7 +157,7 @@ void ChromeCommandLinePrefStore::ApplyProxyMode() {
+@@ -161,7 +161,7 @@ void ChromeCommandLinePrefStore::ApplyProxyMode() {
      SetValue(
          proxy_config::prefs::kProxy,
          std::make_unique<base::Value>(ProxyConfigDictionary::CreateFixedServers(
@@ -627,7 +627,7 @@ new file mode 100644
 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
-@@ -265,6 +265,8 @@ static_library("ui") {
+@@ -278,6 +278,8 @@ static_library("ui") {
      "webui/metrics_handler.h",
      "webui/net_export_ui.cc",
      "webui/net_export_ui.h",
@@ -645,9 +645,9 @@ diff --git a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc b/chrom
  #include "chrome/browser/ui/webui/predictors/predictors_ui.h"
 +#include "chrome/browser/ui/webui/proxy_config_ui.h"
  #include "chrome/browser/ui/webui/quota_internals/quota_internals_ui.h"
+ #include "chrome/browser/ui/webui/segmentation_internals/segmentation_internals_ui.h"
  #include "chrome/browser/ui/webui/signin_internals_ui.h"
- #include "chrome/browser/ui/webui/sync_internals/sync_internals_ui.h"
-@@ -638,6 +639,8 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui,
+@@ -671,6 +672,8 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui,
      return &NewWebUI<MemoryInternalsUI>;
    if (url.host_piece() == chrome::kChromeUINetExportHost)
      return &NewWebUI<NetExportUI>;
@@ -660,7 +660,7 @@ diff --git a/chrome/browser/ui/webui/proxy_config_ui.cc b/chrome/browser/ui/webu
 new file mode 100644
 --- /dev/null
 +++ b/chrome/browser/ui/webui/proxy_config_ui.cc
-@@ -0,0 +1,419 @@
+@@ -0,0 +1,418 @@
 +/*
 +    This file is part of Bromite.
 +
@@ -689,7 +689,6 @@ new file mode 100644
 +#include "base/bind.h"
 +#include "base/command_line.h"
 +#include "base/lazy_instance.h"
-+#include "base/macros.h"
 +#include "base/memory/ref_counted.h"
 +#include "base/strings/string_util.h"
 +#include "base/strings/utf_string_conversions.h"
@@ -737,6 +736,8 @@ new file mode 100644
 +      public base::SupportsWeakPtr<ProxyConfigMessageHandler>,
 +      public net::ProxyConfigService::Observer {
 + public:
++  ProxyConfigMessageHandler(const ProxyConfigMessageHandler&) = delete;
++  ProxyConfigMessageHandler& operator=(const ProxyConfigMessageHandler&) = delete;
 +  // Creates a ProxyConfigMessageHandler that handles message exchanges with the Javascript
 +  // side of the UI and gets proxy settings from the Web UI associated profile to watch for changes.
 +  // The created ProxyConfigMessageHandler must be destroyed before |profile|.
@@ -771,8 +772,6 @@ new file mode 100644
 +  void apply(const net::ProxyConfig& config);
 +
 +  base::WeakPtrFactory<ProxyConfigMessageHandler> weak_ptr_factory_;
-+
-+  DISALLOW_COPY_AND_ASSIGN(ProxyConfigMessageHandler);
 +};
 +
 +ProxyConfigMessageHandler::ProxyConfigMessageHandler(Profile *profile)
@@ -801,7 +800,7 @@ new file mode 100644
 +  }
 +
 +  proxy_config_service_ = ProxyServiceFactory::CreateProxyConfigService(
-+      pref_proxy_config_tracker_.get());
++      pref_proxy_config_tracker_.get(), nullptr);
 +}
 +
 +void ProxyConfigMessageHandler::OnProxyConfigChanged(
@@ -1084,7 +1083,7 @@ diff --git a/chrome/browser/ui/webui/proxy_config_ui.h b/chrome/browser/ui/webui
 new file mode 100644
 --- /dev/null
 +++ b/chrome/browser/ui/webui/proxy_config_ui.h
-@@ -0,0 +1,33 @@
+@@ -0,0 +1,31 @@
 +/*
 +    This file is part of Bromite.
 +
@@ -1105,23 +1104,21 @@ new file mode 100644
 +#ifndef CHROME_BROWSER_UI_WEBUI_PROXY_CONFIG_UI_H_
 +#define CHROME_BROWSER_UI_WEBUI_PROXY_CONFIG_UI_H_
 +
-+#include "base/macros.h"
 +#include "content/public/browser/web_ui_controller.h"
 +
 +// The WebUI for chrome://proxy/.
 +class ProxyConfigUI : public content::WebUIController {
 + public:
++  ProxyConfigUI(const ProxyConfigUI&) = delete;
++  ProxyConfigUI& operator=(const ProxyConfigUI&) = delete;
 +  explicit ProxyConfigUI(content::WebUI* web_ui);
-+
-+ private:
-+  DISALLOW_COPY_AND_ASSIGN(ProxyConfigUI);
 +};
 +
 +#endif  // CHROME_BROWSER_UI_WEBUI_PROXY_CONFIG_UI_H_
 diff --git a/chrome/common/webui_url_constants.cc b/chrome/common/webui_url_constants.cc
 --- a/chrome/common/webui_url_constants.cc
 +++ b/chrome/common/webui_url_constants.cc
-@@ -35,6 +35,8 @@ const char kChromeUICertificateViewerHost[] = "view-cert";
+@@ -37,6 +37,8 @@ const char kChromeUICertificateViewerHost[] = "view-cert";
  const char kChromeUICertificateViewerURL[] = "chrome://view-cert/";
  const char kChromeUIChromeSigninHost[] = "chrome-signin";
  const char kChromeUIChromeSigninURL[] = "chrome://chrome-signin/";
@@ -1130,7 +1127,7 @@ diff --git a/chrome/common/webui_url_constants.cc b/chrome/common/webui_url_cons
  const char kChromeUIChromeURLsHost[] = "chrome-urls";
  const char kChromeUIChromeURLsURL[] = "chrome://chrome-urls/";
  const char kChromeUIComponentsHost[] = "components";
-@@ -346,6 +348,7 @@ bool IsSystemWebUIHost(base::StringPiece host) {
+@@ -393,6 +395,7 @@ bool IsSystemWebUIHost(base::StringPiece host) {
      kChromeUIMobileSetupHost,
      kChromeUIMultiDeviceSetupHost,
      kChromeUINetworkHost,
@@ -1138,7 +1135,7 @@ diff --git a/chrome/common/webui_url_constants.cc b/chrome/common/webui_url_cons
      kChromeUIOobeHost,
      kChromeUIOSCreditsHost,
      kChromeUIOSSettingsHost,
-@@ -568,6 +571,7 @@ const char* const kChromeHostURLs[] = {
+@@ -627,6 +630,7 @@ const char* const kChromeHostURLs[] = {
  #if !defined(OS_ANDROID)
  #if !BUILDFLAG(IS_CHROMEOS_ASH)
      kChromeUIAppLauncherPageHost,
@@ -1149,7 +1146,7 @@ diff --git a/chrome/common/webui_url_constants.cc b/chrome/common/webui_url_cons
 diff --git a/chrome/common/webui_url_constants.h b/chrome/common/webui_url_constants.h
 --- a/chrome/common/webui_url_constants.h
 +++ b/chrome/common/webui_url_constants.h
-@@ -126,6 +126,8 @@ extern const char kChromeUIMemoryInternalsHost[];
+@@ -129,6 +129,8 @@ extern const char kChromeUIMemoryInternalsHost[];
  extern const char kChromeUINTPTilesInternalsHost[];
  extern const char kChromeUINaClHost[];
  extern const char kChromeUINetExportHost[];
@@ -1172,7 +1169,7 @@ diff --git a/components/proxy_config/pref_proxy_config_tracker_impl.cc b/compone
 diff --git a/components/proxy_config/proxy_config_dictionary.cc b/components/proxy_config/proxy_config_dictionary.cc
 --- a/components/proxy_config/proxy_config_dictionary.cc
 +++ b/components/proxy_config/proxy_config_dictionary.cc
-@@ -28,6 +28,8 @@ const char kProxyPacMandatory[] = "pac_mandatory";
+@@ -30,6 +30,8 @@ const char kProxyPacMandatory[] = "pac_mandatory";
  // String containing proxy bypass rules. For a specification of the
  // expected syntax see net::ProxyBypassRules::ParseFromString().
  const char kProxyBypassList[] = "bypass_list";
@@ -1181,7 +1178,7 @@ diff --git a/components/proxy_config/proxy_config_dictionary.cc b/components/pro
  
  }  // namespace
  
-@@ -72,6 +74,14 @@ bool ProxyConfigDictionary::HasBypassList() const {
+@@ -78,6 +80,14 @@ bool ProxyConfigDictionary::HasBypassList() const {
    return dict_.FindKey(kProxyBypassList);
  }
  
@@ -1196,7 +1193,7 @@ diff --git a/components/proxy_config/proxy_config_dictionary.cc b/components/pro
  const base::Value& ProxyConfigDictionary::GetDictionary() const {
    return dict_;
  }
-@@ -79,29 +89,30 @@ const base::Value& ProxyConfigDictionary::GetDictionary() const {
+@@ -85,29 +95,30 @@ const base::Value& ProxyConfigDictionary::GetDictionary() const {
  // static
  base::Value ProxyConfigDictionary::CreateDirect() {
    return CreateDictionary(ProxyPrefs::MODE_DIRECT, std::string(), false,
@@ -1232,7 +1229,7 @@ diff --git a/components/proxy_config/proxy_config_dictionary.cc b/components/pro
    } else {
      return CreateDirect();
    }
-@@ -110,7 +121,7 @@ base::Value ProxyConfigDictionary::CreateFixedServers(
+@@ -116,7 +127,7 @@ base::Value ProxyConfigDictionary::CreateFixedServers(
  // static
  base::Value ProxyConfigDictionary::CreateSystem() {
    return CreateDictionary(ProxyPrefs::MODE_SYSTEM, std::string(), false,
@@ -1241,7 +1238,7 @@ diff --git a/components/proxy_config/proxy_config_dictionary.cc b/components/pro
  }
  
  // static
-@@ -119,7 +130,8 @@ base::Value ProxyConfigDictionary::CreateDictionary(
+@@ -125,7 +136,8 @@ base::Value ProxyConfigDictionary::CreateDictionary(
      const std::string& pac_url,
      bool pac_mandatory,
      const std::string& proxy_server,
@@ -1251,7 +1248,7 @@ diff --git a/components/proxy_config/proxy_config_dictionary.cc b/components/pro
    base::Value dict(base::Value::Type::DICTIONARY);
    dict.SetKey(kProxyMode, base::Value(ProxyModeToString(mode)));
    if (!pac_url.empty()) {
-@@ -128,8 +140,10 @@ base::Value ProxyConfigDictionary::CreateDictionary(
+@@ -134,8 +146,10 @@ base::Value ProxyConfigDictionary::CreateDictionary(
    }
    if (!proxy_server.empty())
      dict.SetKey(kProxyServer, base::Value(proxy_server));
@@ -1266,7 +1263,7 @@ diff --git a/components/proxy_config/proxy_config_dictionary.cc b/components/pro
 diff --git a/components/proxy_config/proxy_config_dictionary.h b/components/proxy_config/proxy_config_dictionary.h
 --- a/components/proxy_config/proxy_config_dictionary.h
 +++ b/components/proxy_config/proxy_config_dictionary.h
-@@ -38,6 +38,7 @@ class PROXY_CONFIG_EXPORT ProxyConfigDictionary {
+@@ -42,6 +42,7 @@ class PROXY_CONFIG_EXPORT ProxyConfigDictionary {
    bool GetProxyServer(std::string* out) const;
    bool GetBypassList(std::string* out) const;
    bool HasBypassList() const;
@@ -1274,7 +1271,7 @@ diff --git a/components/proxy_config/proxy_config_dictionary.h b/components/prox
  
    const base::Value& GetDictionary() const;
  
-@@ -46,7 +47,8 @@ class PROXY_CONFIG_EXPORT ProxyConfigDictionary {
+@@ -50,7 +51,8 @@ class PROXY_CONFIG_EXPORT ProxyConfigDictionary {
    static base::Value CreatePacScript(const std::string& pac_url,
                                       bool pac_mandatory);
    static base::Value CreateFixedServers(const std::string& proxy_server,
@@ -1284,7 +1281,7 @@ diff --git a/components/proxy_config/proxy_config_dictionary.h b/components/prox
    static base::Value CreateSystem();
  
    // Encodes the proxy server as "<url-scheme>=<proxy-scheme>://<proxy>".
-@@ -62,7 +64,8 @@ class PROXY_CONFIG_EXPORT ProxyConfigDictionary {
+@@ -66,7 +68,8 @@ class PROXY_CONFIG_EXPORT ProxyConfigDictionary {
                                        const std::string& pac_url,
                                        bool pac_mandatory,
                                        const std::string& proxy_server,
@@ -1293,7 +1290,7 @@ diff --git a/components/proxy_config/proxy_config_dictionary.h b/components/prox
 +                                      bool reverse_bypass);
  
    base::Value dict_;
- 
+ };
 diff --git a/components/proxy_config/proxy_policy_handler.cc b/components/proxy_config/proxy_policy_handler.cc
 --- a/components/proxy_config/proxy_policy_handler.cc
 +++ b/components/proxy_config/proxy_policy_handler.cc
@@ -1309,7 +1306,7 @@ diff --git a/components/proxy_config/proxy_policy_handler.cc b/components/proxy_
 diff --git a/net/proxy_resolution/proxy_config.cc b/net/proxy_resolution/proxy_config.cc
 --- a/net/proxy_resolution/proxy_config.cc
 +++ b/net/proxy_resolution/proxy_config.cc
-@@ -110,7 +110,7 @@ void ProxyConfig::ProxyRules::ParseFromString(const std::string& proxy_rules) {
+@@ -112,7 +112,7 @@ void ProxyConfig::ProxyRules::ParseFromString(const std::string& proxy_rules) {
                                     &single_proxies,
                                     ProxyServer::SCHEME_HTTP);
          type = Type::PROXY_LIST;
@@ -1318,7 +1315,7 @@ diff --git a/net/proxy_resolution/proxy_config.cc b/net/proxy_resolution/proxy_c
        }
  
        // Trim whitespace off the url scheme.
-@@ -141,6 +141,56 @@ void ProxyConfig::ProxyRules::ParseFromString(const std::string& proxy_rules) {
+@@ -143,6 +143,56 @@ void ProxyConfig::ProxyRules::ParseFromString(const std::string& proxy_rules) {
    }
  }
  
@@ -1332,7 +1329,7 @@ diff --git a/net/proxy_resolution/proxy_config.cc b/net/proxy_resolution/proxy_c
 +    std::string proxy_list;
 +    for (const ProxyServer& proxy_server :
 +         single_proxies.GetAll()) {
-+      proxy_list += proxy_server.ToURI() + ";";
++      proxy_list += ProxyServerToProxyUri(proxy_server) + ";";
 +    }
 +    // remove last semicolon
 +    if (proxy_list.length() != 0 ) {
@@ -1351,19 +1348,19 @@ diff --git a/net/proxy_resolution/proxy_config.cc b/net/proxy_resolution/proxy_c
 +  std::string list;
 +  for (const ProxyServer& proxy_server :
 +       proxies_for_http.GetAll()) {
-+    list += "http=" + proxy_server.ToURI() + ";";
++    list += "http=" + ProxyServerToProxyUri(proxy_server) + ";";
 +  }
 +  for (const ProxyServer& proxy_server :
 +       proxies_for_https.GetAll()) {
-+    list += "https=" + proxy_server.ToURI() + ";";
++    list += "https=" + ProxyServerToProxyUri(proxy_server) + ";";
 +  }
 +  for (const ProxyServer& proxy_server :
 +       proxies_for_ftp.GetAll()) {
-+    list += "ftp=" + proxy_server.ToURI() + ";";
++    list += "ftp=" + ProxyServerToProxyUri(proxy_server) + ";";
 +  }
 +  for (const ProxyServer& proxy_server :
 +       fallback_proxies.GetAll()) {
-+    list += "socks=" + proxy_server.ToURI() + ";";
++    list += "socks=" + ProxyServerToProxyUri(proxy_server) + ";";
 +  }
 +  if (list.length() != 0 ) {
 +    // remove last semicolon
@@ -1388,6 +1385,5 @@ diff --git a/net/proxy_resolution/proxy_config.h b/net/proxy_resolution/proxy_co
  
      // Returns one of {&proxies_for_http, &proxies_for_https, &proxies_for_ftp,
      // &fallback_proxies}, or NULL if there is no proxy to use.
--- 
-2.20.1
-
+--
+2.25.1

+ 70 - 43
build/patches/Add-an-always-incognito-mode.patch

@@ -19,6 +19,7 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c
  .../browser/init/StartupTabPreloader.java     | 14 +++-
  .../privacy/settings/PrivacySettings.java     | 37 ++++++++-
  .../browser/settings/SettingsActivity.java    |  4 +
+ .../tabbed_mode/TabbedRootUiCoordinator.java  |  6 +-
  .../browser/tabmodel/ChromeTabCreator.java    | 16 +++-
  .../browser/tabmodel/TabPersistentStore.java  | 10 +++
  .../webapps/WebappIntentDataProvider.java     | 14 ++++
@@ -26,7 +27,7 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c
  .../strings/android_chrome_strings.grd        | 13 +++
  chrome/browser/ui/messages/android/BUILD.gn   |  1 +
  .../snackbar/INeedSnackbarManager.java        | 27 +++++++
- 19 files changed, 243 insertions(+), 35 deletions(-)
+ 20 files changed, 248 insertions(+), 36 deletions(-)
  create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/AlwaysIncognitoLinkInterceptor.java
  create mode 100644 chrome/browser/ui/messages/android/java/src/org/chromium/chrome/browser/ui/messages/snackbar/INeedSnackbarManager.java
 
@@ -44,7 +45,7 @@ diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java
 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
-@@ -32,6 +32,11 @@
+@@ -37,6 +37,11 @@
          android:key="secure_dns"
          android:title="@string/settings_secure_dns_title"
          android:fragment="org.chromium.chrome.browser.privacy.secure_dns.SecureDnsSettings"/>
@@ -152,7 +153,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedAct
  import org.chromium.chrome.browser.IntentHandler.IntentHandlerDelegate;
  import org.chromium.chrome.browser.IntentHandler.TabOpenType;
  import org.chromium.chrome.browser.accessibility_tab_switcher.OverviewListLayout;
-@@ -1766,8 +1767,9 @@ public class ChromeTabbedActivity extends ChromeActivity<ChromeActivityComponent
+@@ -1780,8 +1781,9 @@ public class ChromeTabbedActivity extends ChromeActivity<ChromeActivityComponent
          Bundle savedInstanceState = getSavedInstanceState();
  
          // We determine the model as soon as possible so every systems get initialized coherently.
@@ -167,7 +168,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedAct
 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
 --- a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
 +++ b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
-@@ -101,6 +101,7 @@ import org.chromium.chrome.browser.contextualsearch.ContextualSearchFieldTrial;
+@@ -102,6 +102,7 @@ import org.chromium.chrome.browser.contextualsearch.ContextualSearchFieldTrial;
  import org.chromium.chrome.browser.contextualsearch.ContextualSearchManager;
  import org.chromium.chrome.browser.contextualsearch.ContextualSearchManager.ContextualSearchTabPromotionDelegate;
  import org.chromium.chrome.browser.dependency_injection.ChromeActivityCommonsModule;
@@ -175,7 +176,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActiv
  import org.chromium.chrome.browser.dependency_injection.ChromeActivityComponent;
  import org.chromium.chrome.browser.dependency_injection.ModuleFactoryOverrides;
  import org.chromium.chrome.browser.device.DeviceClassManager;
-@@ -1884,6 +1885,9 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
+@@ -1952,6 +1953,9 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
              throw new IllegalStateException(
                      "Attempting to access TabCreator before initialization");
          }
@@ -188,7 +189,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActiv
 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateImpl.java
 --- a/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateImpl.java
 +++ b/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateImpl.java
-@@ -378,6 +378,12 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate
+@@ -524,6 +524,12 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate
      }
  
      private void prepareCommonMenuItems(Menu menu, @MenuGroup int menuGroup, boolean isIncognito) {
@@ -200,7 +201,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/App
 +
          // We have to iterate all menu items since same menu item ID may be associated with more
          // than one menu items.
-         boolean isMenuGroupTabsVisible = TabUiFeatureUtilities.isTabGroupsAndroidEnabled(mContext)
+         boolean isOverviewModeMenu = menuGroup == MenuGroup.OVERVIEW_MODE_MENU;
 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java
 --- a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java
 +++ b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java
@@ -300,9 +301,9 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/Cust
 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/init/StartupTabPreloader.java b/chrome/android/java/src/org/chromium/chrome/browser/init/StartupTabPreloader.java
 --- a/chrome/android/java/src/org/chromium/chrome/browser/init/StartupTabPreloader.java
 +++ b/chrome/android/java/src/org/chromium/chrome/browser/init/StartupTabPreloader.java
-@@ -34,6 +34,9 @@ import org.chromium.content_public.browser.WebContents;
- import org.chromium.ui.base.WindowAndroid;
- import org.chromium.url.GURL;
+@@ -42,6 +42,9 @@ import org.chromium.url.GURL;
+ import java.lang.annotation.Retention;
+ import java.lang.annotation.RetentionPolicy;
  
 +import org.chromium.base.ContextUtils;
 +import org.chromium.chrome.browser.AlwaysIncognitoLinkInterceptor;
@@ -310,7 +311,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/init/StartupTab
  /**
   * This class attempts to preload the tab if the url is known from the intent when the profile
   * is created. This is done to improve startup latency.
-@@ -185,17 +188,22 @@ public class StartupTabPreloader implements ProfileManager.Observer, DestroyObse
+@@ -446,17 +449,22 @@ public class StartupTabPreloader implements ProfileManager.Observer, DestroyObse
          Intent intent = mIntentSupplier.get();
          GURL url = UrlFormatter.fixupUrl(getUrlFromIntent(intent));
  
@@ -339,18 +340,18 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/init/StartupTab
 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
 --- a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
 +++ b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
-@@ -26,6 +26,10 @@ import org.chromium.chrome.browser.profiles.Profile;
+@@ -28,6 +28,10 @@ import org.chromium.chrome.browser.privacy_sandbox.PrivacySandboxSettingsFragmen
+ import org.chromium.chrome.browser.profiles.Profile;
  import org.chromium.chrome.browser.settings.ChromeManagedPreferenceDelegate;
  import org.chromium.chrome.browser.settings.SettingsLauncherImpl;
- import org.chromium.chrome.browser.signin.services.IdentityServicesProvider;
 +import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager;
 +import org.chromium.chrome.browser.ui.messages.snackbar.INeedSnackbarManager;
 +import org.chromium.chrome.browser.ui.messages.snackbar.Snackbar;
 +import org.chromium.chrome.browser.ApplicationLifetime;
+ import org.chromium.chrome.browser.signin.services.IdentityServicesProvider;
  import org.chromium.components.browser_ui.settings.ChromeSwitchPreference;
  import org.chromium.components.browser_ui.settings.ManagedPreferenceDelegate;
- import org.chromium.components.browser_ui.settings.SettingsLauncher;
-@@ -40,7 +44,12 @@ import org.chromium.ui.text.SpanApplier;
+@@ -43,7 +47,12 @@ import org.chromium.ui.text.SpanApplier;
   * Fragment to keep track of the all the privacy related preferences.
   */
  public class PrivacySettings
@@ -362,9 +363,9 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting
 +
 +    private static final String PREF_ALWAYS_INCOGNITO = "always_incognito";
      private static final String PREF_CAN_MAKE_PAYMENT = "can_make_payment";
-     private static final String PREF_NETWORK_PREDICTIONS = "preload_pages";
+     private static final String PREF_PRELOAD_PAGES = "preload_pages";
      private static final String PREF_HTTPS_FIRST_MODE = "https_first_mode";
-@@ -83,6 +92,25 @@ public class PrivacySettings
+@@ -100,6 +109,25 @@ public class PrivacySettings
                  (ChromeSwitchPreference) findPreference(PREF_CAN_MAKE_PAYMENT);
          canMakePaymentPref.setOnPreferenceChangeListener(this);
  
@@ -387,20 +388,20 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting
 +                        /*actionData*/null)
 +                .setDuration(/*durationMs*/70000);
 +
-         ChromeSwitchPreference networkPredictionPref =
-                 (ChromeSwitchPreference) findPreference(PREF_NETWORK_PREDICTIONS);
-         networkPredictionPref.setChecked(
-@@ -114,6 +142,9 @@ public class PrivacySettings
-         } else if (PREF_NETWORK_PREDICTIONS.equals(key)) {
-             PrivacyPreferencesManagerImpl.getInstance().setNetworkPredictionEnabled(
-                     (boolean) newValue);
-+        } else if (PREF_ALWAYS_INCOGNITO.equals(key)) {
-+            if (!mSnackbarManager.isShowing())
-+                mSnackbarManager.showSnackbar(mSnackbar);
+         Preference preloadPagesPreference = findPreference(PREF_PRELOAD_PAGES);
+         preloadPagesPreference.setSummary(
+                 PreloadPagesSettingsFragment.getPreloadPagesSummaryString(getContext()));
+@@ -128,6 +156,9 @@ public class PrivacySettings
          } else if (PREF_HTTPS_FIRST_MODE.equals(key)) {
              UserPrefs.get(Profile.getLastUsedRegularProfile())
                      .setBoolean(Pref.HTTPS_ONLY_MODE_ENABLED, (boolean) newValue);
-@@ -191,4 +222,8 @@ public class PrivacySettings
++        } else if (PREF_ALWAYS_INCOGNITO.equals(key)) {
++            if (!mSnackbarManager.isShowing())
++                mSnackbarManager.showSnackbar(mSnackbar);
+         }
+         return true;
+     }
+@@ -201,4 +232,8 @@ public class PrivacySettings
          }
          return false;
      }
@@ -419,8 +420,8 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/Settin
 +import org.chromium.chrome.browser.ui.messages.snackbar.INeedSnackbarManager;
  import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager;
  import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager.SnackbarManageable;
- import org.chromium.components.browser_ui.settings.FragmentSettingsLauncher;
-@@ -171,6 +172,9 @@ public class SettingsActivity extends ChromeBaseAppCompatActivity
+ import org.chromium.components.browser_ui.bottomsheet.BottomSheetController;
+@@ -206,6 +207,9 @@ public class SettingsActivity extends ChromeBaseAppCompatActivity
                                                            .getSiteSettingsDelegate());
              delegate.setSnackbarManager(mSnackbarManager);
          }
@@ -430,6 +431,33 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/Settin
      }
  
      @Override
+diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java
+--- a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java
++++ b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java
+@@ -119,6 +119,8 @@ import org.chromium.ui.base.DeviceFormFactor;
+ import org.chromium.ui.base.IntentRequestTracker;
+ import org.chromium.ui.modaldialog.ModalDialogManager;
+ import org.chromium.ui.util.TokenHolder;
++import org.chromium.base.ContextUtils;
++import org.chromium.chrome.browser.AlwaysIncognitoLinkInterceptor;
+ 
+ /**
+  * A {@link RootUiCoordinator} variant that controls tabbed-mode specific UI.
+@@ -489,11 +491,13 @@ public class TabbedRootUiCoordinator extends RootUiCoordinator {
+ 
+         // TODO(twellington): Supply TabModelSelector as well and move initialization earlier.
+         if (DeviceFormFactor.isNonMultiDisplayContextOnTablet(mActivity)) {
++            boolean tabModel = ContextUtils.getAppSharedPreferences().getBoolean(
++                        AlwaysIncognitoLinkInterceptor.PREF_ALWAYS_INCOGNITO, false);
+             AppMenuHandler appMenuHandler =
+                     mAppMenuCoordinator == null ? null : mAppMenuCoordinator.getAppMenuHandler();
+             mEmptyBackgroundViewWrapper = new EmptyBackgroundViewWrapper(
+                     mTabModelSelectorSupplier.get(),
+-                    mTabCreatorManagerSupplier.get().getTabCreator(false), mActivity,
++                    mTabCreatorManagerSupplier.get().getTabCreator(tabModel), mActivity,
+                     appMenuHandler, mSnackbarManagerSupplier.get(), mOverviewModeBehaviorSupplier);
+             mEmptyBackgroundViewWrapper.initialize();
+         }
 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreator.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreator.java
 --- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreator.java
 +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreator.java
@@ -509,7 +537,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPer
  import org.chromium.base.Log;
  import org.chromium.base.ObserverList;
  import org.chromium.base.StreamUtil;
-@@ -56,6 +57,8 @@ import org.chromium.content_public.browser.LoadUrlParams;
+@@ -57,6 +58,8 @@ import org.chromium.content_public.browser.LoadUrlParams;
  import org.chromium.content_public.browser.UiThreadTaskTraits;
  import org.chromium.url.GURL;
  
@@ -518,7 +546,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPer
  import java.io.BufferedInputStream;
  import java.io.ByteArrayInputStream;
  import java.io.ByteArrayOutputStream;
-@@ -654,6 +657,13 @@ public class TabPersistentStore {
+@@ -651,6 +654,13 @@ public class TabPersistentStore {
                  }
              }
          }
@@ -535,9 +563,9 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPer
 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappIntentDataProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappIntentDataProvider.java
 --- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappIntentDataProvider.java
 +++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappIntentDataProvider.java
-@@ -28,6 +28,9 @@ import org.chromium.chrome.browser.browserservices.intents.WebappExtras;
- import org.chromium.chrome.browser.flags.ActivityType;
+@@ -32,6 +32,9 @@ import org.chromium.chrome.browser.flags.ActivityType;
  import org.chromium.components.browser_ui.widget.TintedDrawable;
+ import org.chromium.device.mojom.ScreenOrientationLockType;
  
 +import org.chromium.base.ContextUtils;
 +import org.chromium.chrome.browser.AlwaysIncognitoLinkInterceptor;
@@ -545,7 +573,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappI
  /**
   * Stores info about a web app.
   */
-@@ -41,6 +44,8 @@ public class WebappIntentDataProvider extends BrowserServicesIntentDataProvider
+@@ -45,6 +48,8 @@ public class WebappIntentDataProvider extends BrowserServicesIntentDataProvider
      private final Intent mIntent;
      private final ColorProviderImpl mColorProvider;
  
@@ -554,7 +582,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappI
      /**
       * Returns the toolbar color to use if a custom color is not specified by the webapp.
       */
-@@ -62,6 +67,10 @@ public class WebappIntentDataProvider extends BrowserServicesIntentDataProvider
+@@ -67,6 +72,10 @@ public class WebappIntentDataProvider extends BrowserServicesIntentDataProvider
          mWebappExtras = webappExtras;
          mWebApkExtras = webApkExtras;
          mActivityType = (webApkExtras != null) ? ActivityType.WEB_APK : ActivityType.WEBAPP;
@@ -565,7 +593,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappI
      }
  
      @Override
-@@ -150,6 +159,11 @@ public class WebappIntentDataProvider extends BrowserServicesIntentDataProvider
+@@ -155,6 +164,11 @@ public class WebappIntentDataProvider extends BrowserServicesIntentDataProvider
          return mWebApkExtras;
      }
  
@@ -575,12 +603,12 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappI
 +    }
 +
      @Override
-     public int getDefaultOrientation() {
+     public @ScreenOrientationLockType.EnumType int getDefaultOrientation() {
          return mWebappExtras.orientation;
 diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc
 --- a/chrome/browser/flags/android/chrome_feature_list.cc
 +++ b/chrome/browser/flags/android/chrome_feature_list.cc
-@@ -445,7 +445,7 @@ const base::Feature kCCTIncognito{"CCTIncognito",
+@@ -456,7 +456,7 @@ const base::Feature kCCTIncognito{"CCTIncognito",
                                    base::FEATURE_ENABLED_BY_DEFAULT};
  
  const base::Feature kCCTIncognitoAvailableToThirdParty{
@@ -592,7 +620,7 @@ diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browse
 diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
 --- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
 +++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
-@@ -922,6 +922,19 @@ Your Google account may have other forms of browsing history like searches and a
+@@ -981,6 +981,19 @@ Your Google account may have other forms of browsing history like searches and a
        <message name="IDS_CLEAR_BROWSING_HISTORY_SUMMARY_SYNCED_NO_LINK" desc="A text for the basic tab explaining browsing history for users with history sync. This version is shown when the link to MyActivity is displayed separately.">
          Clears history from all synced devices.
        </message>
@@ -655,6 +683,5 @@ new file mode 100644
 +public interface INeedSnackbarManager {
 +    void setSnackbarManager(SnackbarManager manager);
 +}
--- 
-2.20.1
-
+--
+2.25.1

+ 88 - 94
build/patches/Add-bookmark-import-export-actions.patch

@@ -14,7 +14,7 @@ Completely remove contacts picker permission from the file dialog
  .../browser/TabbedModeTabDelegateFactory.java |   5 +-
  .../browser/bookmarks/BookmarkActionBar.java  |  12 +
  .../browser/bookmarks/BookmarkActivity.java   |  30 ++
- .../browser/bookmarks/BookmarkBridge.java     | 277 +++++++++++++++++
+ .../browser/bookmarks/BookmarkBridge.java     | 279 +++++++++++++++++
  .../browser/bookmarks/BookmarkDelegate.java   |  10 +
  .../browser/bookmarks/BookmarkManager.java    |  22 ++
  .../browser/bookmarks/BookmarkPage.java       |   8 +-
@@ -22,7 +22,7 @@ Completely remove contacts picker permission from the file dialog
  chrome/browser/BUILD.gn                       |  11 +-
  chrome/browser/about_flags.cc                 |   6 +
  .../android/bookmarks/bookmark_bridge.cc      | 284 ++++++++++++++++++
- .../android/bookmarks/bookmark_bridge.h       |  28 +-
+ .../android/bookmarks/bookmark_bridge.h       |  30 +-
  .../browser/bookmarks/bookmark_html_writer.cc |   8 +-
  .../dialogs/DownloadLocationCustomView.java   |   8 +-
  .../DownloadLocationDialogCoordinator.java    |   8 +-
@@ -44,7 +44,7 @@ Completely remove contacts picker permission from the file dialog
  ui/shell_dialogs/select_file_dialog.h         |   2 +
  .../select_file_dialog_android.cc             |   6 +
  ui/shell_dialogs/select_file_dialog_android.h |   2 +
- 38 files changed, 890 insertions(+), 29 deletions(-)
+ 38 files changed, 894 insertions(+), 29 deletions(-)
 
 diff --git a/base/android/content_uri_utils.cc b/base/android/content_uri_utils.cc
 --- a/base/android/content_uri_utils.cc
@@ -196,7 +196,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/TabbedModeTabDe
 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkActionBar.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkActionBar.java
 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkActionBar.java
 +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkActionBar.java
-@@ -84,6 +84,12 @@ public class BookmarkActionBar extends SelectableListToolbar<BookmarkId>
+@@ -86,6 +86,12 @@ public class BookmarkActionBar extends SelectableListToolbar<BookmarkId>
          } else if (menuItem.getItemId() == R.id.search_menu_id) {
              mDelegate.openSearchUI();
              return true;
@@ -209,7 +209,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm
          }
  
          SelectionDelegate<BookmarkId> selectionDelegate = mDelegate.getSelectionDelegate();
-@@ -135,6 +141,8 @@ public class BookmarkActionBar extends SelectableListToolbar<BookmarkId>
+@@ -137,6 +143,8 @@ public class BookmarkActionBar extends SelectableListToolbar<BookmarkId>
      void showLoadingUi() {
          setTitle(null);
          setNavigationButton(NAVIGATION_BUTTON_NONE);
@@ -218,7 +218,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm
          getMenu().findItem(R.id.search_menu_id).setVisible(false);
          getMenu().findItem(R.id.edit_menu_id).setVisible(false);
      }
-@@ -144,6 +152,8 @@ public class BookmarkActionBar extends SelectableListToolbar<BookmarkId>
+@@ -146,6 +154,8 @@ public class BookmarkActionBar extends SelectableListToolbar<BookmarkId>
          super.showNormalView();
  
          if (mDelegate == null) {
@@ -227,10 +227,10 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm
              getMenu().findItem(R.id.search_menu_id).setVisible(false);
              getMenu().findItem(R.id.edit_menu_id).setVisible(false);
          }
-@@ -174,6 +184,8 @@ public class BookmarkActionBar extends SelectableListToolbar<BookmarkId>
+@@ -175,6 +185,8 @@ public class BookmarkActionBar extends SelectableListToolbar<BookmarkId>
+     @Override
      public void onFolderStateSet(BookmarkId folder) {
          mCurrentFolder = mDelegate.getModel().getBookmarkById(folder);
- 
 +        getMenu().findItem(R.id.import_menu_id).setVisible(true);
 +        getMenu().findItem(R.id.export_menu_id).setVisible(true);
          getMenu().findItem(R.id.search_menu_id).setVisible(true);
@@ -309,10 +309,11 @@ 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/BookmarkBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkBridge.java
 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkBridge.java
 +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkBridge.java
-@@ -4,7 +4,19 @@
+@@ -4,7 +4,20 @@
  
  package org.chromium.chrome.browser.bookmarks;
  
++import android.app.Activity;
 +import android.content.Intent;
 +import android.content.Context;
 +import android.content.pm.PackageManager;
@@ -329,9 +330,9 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm
  import android.text.TextUtils;
  import android.util.Pair;
  
-@@ -27,8 +39,33 @@ import org.chromium.components.url_formatter.UrlFormatter;
- import org.chromium.content_public.browser.WebContents;
- import org.chromium.url.GURL;
+@@ -45,6 +58,33 @@ import java.util.HashMap;
+ import java.util.HashSet;
+ import java.util.List;
  
 +import org.chromium.base.ContentUriUtils;
 +import org.chromium.chrome.R;
@@ -357,13 +358,13 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm
 +import android.content.res.Resources;
 +import org.chromium.base.task.AsyncTask;
 +
- import java.util.ArrayList;
- import java.util.List;
 +import java.io.File;
- 
++
++
  /**
   * Provides the communication channel for Android to fetch and manipulate the
-@@ -585,6 +622,210 @@ public class BookmarkBridge {
+  * bookmark model stored in native.
+@@ -733,6 +773,209 @@ public class BookmarkBridge {
                  mNativeBookmarkBridge, BookmarkBridge.this, id.getId(), id.getType());
      }
  
@@ -515,20 +516,19 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm
 +                if (mDialogModel != null) return;
 +
 +                // Actually show the dialog.
-+                mCustomView = (DownloadLocationCustomView) LayoutInflater.from(mContext).inflate(
++                mCustomView = (DownloadLocationCustomView) LayoutInflater.from(context).inflate(
 +                        R.layout.download_location_dialog, null);
-+                mCustomView.initialize(
-+                        DownloadLocationDialogType.DEFAULT, new File(standardBoorkmarkName), 
-+                        /*totalBytes*/ 0, context.getString(R.string.export_bookmarks_alert_title));
++                mCustomView.initialize(DownloadLocationDialogType.DEFAULT, /*totalBytes*/ 0);
++                mCustomView.setTitle(context.getString(R.string.export_bookmarks_alert_title));
++                mCustomView.setFileName(standardBoorkmarkName);
 +                mCustomView.mDontShowAgain.setVisibility(View.GONE);
 +
-+                Resources resources = mContext.getResources();
++                Resources resources = context.getResources();
 +                mDialogModel = new PropertyModel.Builder(ModalDialogProperties.ALL_KEYS)
 +                                    .with(ModalDialogProperties.CONTROLLER, this)
 +                                    .with(ModalDialogProperties.CUSTOM_VIEW, mCustomView)
 +                                    .with(ModalDialogProperties.POSITIVE_BUTTON_TEXT, resources,
 +                                            R.string.export_bookmarks)
-+                                    .with(ModalDialogProperties.PRIMARY_BUTTON_FILLED, true)
 +                                    .with(ModalDialogProperties.NEGATIVE_BUTTON_TEXT, resources,
 +                                            R.string.cancel)
 +                                    .build();
@@ -568,13 +568,13 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm
 +        };
 +        dialog.initialize(controller);
 +        dialog.showDialog(context, modalDialogManager, /*totalBytes*/ 0,
-+            DownloadLocationDialogType.DEFAULT, /*suggestedPath*/ "");
++            DownloadLocationDialogType.DEFAULT, /*suggestedPath*/ "", /*isIncognito*/ false);
 +    }
 +
      /**
       * Synchronously gets a list of bookmarks that match the specified search query.
       * @param query Keyword used for searching bookmarks.
-@@ -1021,6 +1262,39 @@ public class BookmarkBridge {
+@@ -1301,6 +1544,39 @@ public class BookmarkBridge {
          depthList.add(depth);
      }
  
@@ -614,7 +614,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm
      private static List<Pair<Integer, Integer>> createPairsList(int[] left, int[] right) {
          List<Pair<Integer, Integer>> pairList = new ArrayList<Pair<Integer, Integer>>();
          for (int i = 0; i < left.length; i++) {
-@@ -1088,6 +1362,9 @@ public class BookmarkBridge {
+@@ -1371,6 +1647,9 @@ public class BookmarkBridge {
          int getChildCount(long nativeBookmarkBridge, BookmarkBridge caller, long id, int type);
          void getChildIDs(long nativeBookmarkBridge, BookmarkBridge caller, long id, int type,
                  List<BookmarkId> bookmarksList);
@@ -665,7 +665,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm
      private BookmarkUndoController mUndoController;
      private final ObserverList<BookmarkUIObserver> mUIObservers = new ObserverList<>();
      private BasicNativePage mNativePage;
-@@ -331,6 +335,14 @@ public class BookmarkManager
+@@ -341,6 +345,14 @@ public class BookmarkManager
          mNativePage = nativePage;
      }
  
@@ -680,7 +680,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm
      /**
       * @return Current URL representing the UI state of bookmark manager. If no state has been shown
       *         yet in this session, on phone return last used state stored in preference; on tablet
-@@ -509,6 +521,16 @@ public class BookmarkManager
+@@ -521,6 +533,16 @@ public class BookmarkManager
          }
      }
  
@@ -747,7 +747,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/native_page/Nat
      private final BottomSheetController mBottomSheetController;
      private final BrowserControlsManager mBrowserControlsManager;
      private final Supplier<Tab> mCurrentTabSupplier;
-@@ -72,7 +73,7 @@ public class NativePageFactory {
+@@ -71,7 +72,7 @@ public class NativePageFactory {
  
      private NativePageBuilder mNativePageBuilder;
  
@@ -756,7 +756,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/native_page/Nat
              @NonNull BottomSheetController sheetController,
              @NonNull BrowserControlsManager browserControlsManager,
              @NonNull Supplier<Tab> currentTabSupplier,
-@@ -123,7 +124,7 @@ public class NativePageFactory {
+@@ -119,7 +120,7 @@ public class NativePageFactory {
  
      @VisibleForTesting
      static class NativePageBuilder {
@@ -765,7 +765,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/native_page/Nat
          private final BottomSheetController mBottomSheetController;
          private final Supplier<NewTabPageUma> mUma;
          private final BrowserControlsManager mBrowserControlsManager;
-@@ -137,7 +138,7 @@ public class NativePageFactory {
+@@ -132,7 +133,7 @@ public class NativePageFactory {
          private final JankTracker mJankTracker;
          private final Supplier<Toolbar> mToolbarSupplier;
  
@@ -774,7 +774,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/native_page/Nat
                  BottomSheetController sheetController,
                  BrowserControlsManager browserControlsManager, Supplier<Tab> currentTabSupplier,
                  Supplier<SnackbarManager> snackbarManagerSupplier,
-@@ -176,7 +177,7 @@ public class NativePageFactory {
+@@ -169,7 +170,7 @@ public class NativePageFactory {
          protected NativePage buildBookmarksPage(Tab tab) {
              return new BookmarkPage(mActivity.getComponentName(), mSnackbarManagerSupplier.get(),
                      mTabModelSelector.isIncognitoSelected(),
@@ -786,7 +786,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/native_page/Nat
 diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
 --- a/chrome/browser/BUILD.gn
 +++ b/chrome/browser/BUILD.gn
-@@ -1832,6 +1832,13 @@ static_library("browser") {
+@@ -1845,6 +1845,13 @@ static_library("browser") {
      "window_placement/window_placement_permission_context.h",
    ]
  
@@ -800,7 +800,7 @@ diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
    configs += [
      "//build/config/compiler:wexit_time_destructors",
      "//build/config:precompiled_headers",
-@@ -2965,6 +2972,8 @@ static_library("browser") {
+@@ -3003,6 +3010,8 @@ static_library("browser") {
        "autofill/manual_filling_view_interface.h",
        "banners/android/chrome_app_banner_manager_android.cc",
        "banners/android/chrome_app_banner_manager_android.h",
@@ -809,21 +809,21 @@ diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
        "browser_process_platform_part_android.cc",
        "browser_process_platform_part_android.h",
        "chrome_browser_field_trials_mobile.cc",
-@@ -3541,8 +3550,6 @@ static_library("browser") {
+@@ -3636,8 +3645,6 @@ static_library("browser") {
        "badging/badge_manager_factory.h",
        "banners/app_banner_manager_desktop.cc",
        "banners/app_banner_manager_desktop.h",
 -      "bookmarks/bookmark_html_writer.cc",
 -      "bookmarks/bookmark_html_writer.h",
-       "browsing_data/chrome_browsing_data_lifetime_manager.cc",
-       "browsing_data/chrome_browsing_data_lifetime_manager.h",
-       "browsing_data/chrome_browsing_data_lifetime_manager_factory.cc",
+       "cart/cart_db.cc",
+       "cart/cart_db.h",
+       "cart/cart_discount_fetcher.cc",
 diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
 --- a/chrome/browser/about_flags.cc
 +++ b/chrome/browser/about_flags.cc
-@@ -7802,6 +7802,12 @@ const FeatureEntry kFeatureEntries[] = {
-      flag_descriptions::kCommerceDeveloperDescription, kOsAll,
-      FEATURE_VALUE_TYPE(commerce::kCommerceDeveloper)},
+@@ -7672,6 +7672,12 @@ const FeatureEntry kFeatureEntries[] = {
+      FEATURE_VALUE_TYPE(features::kRequestDesktopSiteExceptions)},
+ #endif
  
 +    {"export-bookmarks-use-saf",
 +     flag_descriptions::kBookmarksExportUseSafName,
@@ -831,21 +831,13 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
 +     FEATURE_VALUE_TYPE(
 +         chrome::android::kBookmarksExportUseSaf)},
 +
-     // NOTE: Adding a new flag requires adding a corresponding entry to enum
-     // "LoginCustomFlags" in tools/metrics/histograms/enums.xml. See "Flag
-     // Histograms" in tools/metrics/histograms/README.md (run the
+ #if BUILDFLAG(IS_CHROMEOS_ASH)
+     {"snooping-protection", flag_descriptions::kSnoopingProtectionName,
+      flag_descriptions::kSnoopingProtectionDescription, kOsCrOS,
 diff --git a/chrome/browser/android/bookmarks/bookmark_bridge.cc b/chrome/browser/android/bookmarks/bookmark_bridge.cc
 --- a/chrome/browser/android/bookmarks/bookmark_bridge.cc
 +++ b/chrome/browser/android/bookmarks/bookmark_bridge.cc
-@@ -39,6 +39,7 @@
- #include "components/bookmarks/common/android/bookmark_type.h"
- #include "components/bookmarks/common/bookmark_pref_names.h"
- #include "components/bookmarks/managed/managed_bookmark_service.h"
-+#include "components/favicon_base/favicon_usage_data.h"
- #include "components/dom_distiller/core/url_utils.h"
- #include "components/prefs/pref_service.h"
- #include "components/query_parser/query_parser.h"
-@@ -48,6 +49,24 @@
+@@ -56,6 +56,25 @@
  #include "content/public/browser/browser_thread.h"
  #include "content/public/browser/web_contents.h"
  
@@ -860,6 +852,7 @@ diff --git a/chrome/browser/android/bookmarks/bookmark_bridge.cc b/chrome/browse
 +#include "chrome/common/importer/imported_bookmark_entry.h"
 +#include "chrome/common/importer/importer_data_types.h"
 +#include "chrome/common/url_constants.h"
++#include "components/favicon_base/favicon_usage_data.h"
 +#include "components/search_engines/template_url.h"
 +#include "components/url_formatter/url_fixer.h"
 +#include "ui/android/window_android.h"
@@ -870,7 +863,7 @@ diff --git a/chrome/browser/android/bookmarks/bookmark_bridge.cc b/chrome/browse
  using base::android::AttachCurrentThread;
  using base::android::ConvertUTF8ToJavaString;
  using base::android::ConvertUTF16ToJavaString;
-@@ -64,8 +83,93 @@ using bookmarks::BookmarkNode;
+@@ -72,8 +91,93 @@ using bookmarks::BookmarkNode;
  using bookmarks::BookmarkType;
  using content::BrowserThread;
  
@@ -961,10 +954,10 @@ diff --git a/chrome/browser/android/bookmarks/bookmark_bridge.cc b/chrome/browse
 +};
 +
 +
- const int kInvalidId = -1;
- 
  class BookmarkTitleComparer {
-@@ -152,6 +256,10 @@ BookmarkBridge::~BookmarkBridge() {
+  public:
+   explicit BookmarkTitleComparer(BookmarkBridge* bookmark_bridge,
+@@ -160,6 +264,10 @@ BookmarkBridge::~BookmarkBridge() {
    if (partner_bookmarks_shim_)
      partner_bookmarks_shim_->RemoveObserver(this);
    reading_list_manager_->RemoveObserver(this);
@@ -975,7 +968,7 @@ diff --git a/chrome/browser/android/bookmarks/bookmark_bridge.cc b/chrome/browse
  }
  
  void BookmarkBridge::Destroy(JNIEnv*, const JavaParamRef<jobject>&) {
-@@ -543,6 +651,182 @@ jint BookmarkBridge::GetTotalBookmarkCount(
+@@ -577,6 +685,182 @@ jint BookmarkBridge::GetTotalBookmarkCount(
    return count;
  }
  
@@ -1161,7 +1154,7 @@ diff --git a/chrome/browser/android/bookmarks/bookmark_bridge.cc b/chrome/browse
 diff --git a/chrome/browser/android/bookmarks/bookmark_bridge.h b/chrome/browser/android/bookmarks/bookmark_bridge.h
 --- a/chrome/browser/android/bookmarks/bookmark_bridge.h
 +++ b/chrome/browser/android/bookmarks/bookmark_bridge.h
-@@ -17,6 +17,7 @@
+@@ -18,6 +18,7 @@
  #include "base/scoped_observation.h"
  #include "base/strings/utf_string_conversions.h"
  #include "chrome/browser/android/bookmarks/partner_bookmarks_shim.h"
@@ -1169,7 +1162,7 @@ diff --git a/chrome/browser/android/bookmarks/bookmark_bridge.h b/chrome/browser
  #include "chrome/browser/profiles/profile.h"
  #include "chrome/browser/profiles/profile_observer.h"
  #include "chrome/browser/reading_list/android/reading_list_manager.h"
-@@ -25,6 +26,9 @@
+@@ -27,6 +28,9 @@
  #include "components/prefs/pref_change_registrar.h"
  #include "url/android/gurl_android.h"
  
@@ -1179,7 +1172,7 @@ diff --git a/chrome/browser/android/bookmarks/bookmark_bridge.h b/chrome/browser
  namespace bookmarks {
  class BookmarkModel;
  class ManagedBookmarkService;
-@@ -39,7 +43,8 @@ class Profile;
+@@ -42,7 +46,8 @@ class Profile;
  class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver,
                         public PartnerBookmarksShim::Observer,
                         public ReadingListManager::Observer,
@@ -1189,7 +1182,7 @@ diff --git a/chrome/browser/android/bookmarks/bookmark_bridge.h b/chrome/browser
   public:
    BookmarkBridge(JNIEnv* env,
                   const base::android::JavaRef<jobject>& obj,
-@@ -55,6 +60,12 @@ class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver,
+@@ -62,6 +67,12 @@ class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver,
    bool IsDoingExtensiveChanges(JNIEnv* env,
                                 const base::android::JavaParamRef<jobject>& obj);
  
@@ -1202,7 +1195,7 @@ diff --git a/chrome/browser/android/bookmarks/bookmark_bridge.h b/chrome/browser
    jboolean IsEditBookmarksEnabled(JNIEnv* env);
  
    void LoadEmptyPartnerBookmarkShimForTesting(
-@@ -142,6 +153,15 @@ class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver,
+@@ -159,6 +170,15 @@ class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver,
                               jlong id,
                               jint type);
  
@@ -1218,15 +1211,16 @@ diff --git a/chrome/browser/android/bookmarks/bookmark_bridge.h b/chrome/browser
    void SetBookmarkTitle(JNIEnv* env,
                          const base::android::JavaParamRef<jobject>& obj,
                          jlong id,
-@@ -315,12 +335,15 @@ class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver,
+@@ -376,12 +396,16 @@ class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver,
    void DestroyJavaObject();
  
-   Profile* profile_;
+   raw_ptr<Profile> profile_;
 +  base::FilePath export_path_;
 +  BookmarksExportObserver* observer_; // weak
++
    JavaObjectWeakGlobalRef weak_java_ref_;
-   bookmarks::BookmarkModel* bookmark_model_;  // weak
-   bookmarks::ManagedBookmarkService* managed_bookmark_service_;  // weak
+   raw_ptr<bookmarks::BookmarkModel> bookmark_model_;                     // weak
+   raw_ptr<bookmarks::ManagedBookmarkService> managed_bookmark_service_;  // weak
    std::unique_ptr<bookmarks::ScopedGroupBookmarkActions>
        grouped_bookmark_actions_;
    PrefChangeRegistrar pref_change_registrar_;
@@ -1234,15 +1228,16 @@ diff --git a/chrome/browser/android/bookmarks/bookmark_bridge.h b/chrome/browser
  
    // Information about the Partner bookmarks (must check for IsLoaded()).
    // This is owned by profile.
-@@ -332,6 +355,9 @@ class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver,
+@@ -393,6 +417,10 @@ class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver,
    // Observes the profile destruction and creation.
    base::ScopedObservation<Profile, ProfileObserver> profile_observation_{this};
  
 +  const std::string FileSelectedImpl(const base::FilePath& path);
 +  void FileSelectedImplOnUIThread(const base::FilePath& path,
 +                                  const std::string& contents);
-   DISALLOW_COPY_AND_ASSIGN(BookmarkBridge);
- };
++
+   // A means of accessing metadata about bookmarks.
+   OptimizationGuideKeyedService* opt_guide_;
  
 diff --git a/chrome/browser/bookmarks/bookmark_html_writer.cc b/chrome/browser/bookmarks/bookmark_html_writer.cc
 --- a/chrome/browser/bookmarks/bookmark_html_writer.cc
@@ -1255,7 +1250,7 @@ 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"
-@@ -230,7 +231,12 @@ class Writer : public base::RefCountedThreadSafe<Writer> {
+@@ -235,7 +236,12 @@ class Writer : public base::RefCountedThreadSafe<Writer> {
    // Opens the file, returning true on success.
    bool OpenFile() {
      int flags = base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE;
@@ -1272,7 +1267,7 @@ diff --git a/chrome/browser/bookmarks/bookmark_html_writer.cc b/chrome/browser/b
 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
-@@ -46,7 +46,7 @@ public class DownloadLocationCustomView
+@@ -49,7 +49,7 @@ public class DownloadLocationCustomView
      private TextView mFileSize;
      private Spinner mFileLocation;
      private TextView mLocationAvailableSpace;
@@ -1281,7 +1276,7 @@ diff --git a/chrome/browser/download/android/java/src/org/chromium/chrome/browse
      private @DownloadLocationDialogType int mDialogType;
      private long mTotalBytes;
  
-@@ -68,7 +68,7 @@ public class DownloadLocationCustomView
+@@ -72,7 +72,7 @@ public class DownloadLocationCustomView
          mDontShowAgain = findViewById(R.id.show_again_checkbox);
      }
  
@@ -1290,7 +1285,7 @@ diff --git a/chrome/browser/download/android/java/src/org/chromium/chrome/browse
          // TODO(xingliu): Remove this function, currently used by smart suggestion.
          mDialogType = dialogType;
          mTotalBytes = totalBytes;
-@@ -117,7 +117,7 @@ public class DownloadLocationCustomView
+@@ -125,7 +125,7 @@ public class DownloadLocationCustomView
       * @return  The text that the user inputted as the name of the file.
       */
      @Nullable
@@ -1299,7 +1294,7 @@ diff --git a/chrome/browser/download/android/java/src/org/chromium/chrome/browse
          if (mFileName == null || mFileName.getText() == null) return null;
          return mFileName.getText().toString();
      }
-@@ -126,7 +126,7 @@ public class DownloadLocationCustomView
+@@ -134,7 +134,7 @@ public class DownloadLocationCustomView
       * @return  The file path based on what the user selected as the location of the file.
       */
      @Nullable
@@ -1311,7 +1306,7 @@ diff --git a/chrome/browser/download/android/java/src/org/chromium/chrome/browse
 diff --git a/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationDialogCoordinator.java b/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationDialogCoordinator.java
 --- a/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationDialogCoordinator.java
 +++ b/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationDialogCoordinator.java
-@@ -36,12 +36,12 @@ import java.util.ArrayList;
+@@ -37,12 +37,12 @@ import java.util.ArrayList;
  public class DownloadLocationDialogCoordinator implements ModalDialogProperties.Controller {
      @NonNull
      private DownloadLocationDialogController mController;
@@ -1327,7 +1322,7 @@ diff --git a/chrome/browser/download/android/java/src/org/chromium/chrome/browse
      private long mTotalBytes;
      private @DownloadLocationDialogType int mDialogType;
      private String mSuggestedPath;
-@@ -127,7 +127,7 @@ public class DownloadLocationDialogCoordinator implements ModalDialogProperties.
+@@ -131,7 +131,7 @@ public class DownloadLocationDialogCoordinator implements ModalDialogProperties.
       * Called after retrieved the download directory options.
       * @param dirs An list of available download directories.
       */
@@ -1339,7 +1334,7 @@ diff --git a/chrome/browser/download/android/java/src/org/chromium/chrome/browse
 diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
 --- a/chrome/browser/flag_descriptions.cc
 +++ b/chrome/browser/flag_descriptions.cc
-@@ -5415,6 +5415,11 @@ const char kWebKioskEnableLacrosDescription[] =
+@@ -5512,6 +5512,11 @@ const char kWebKioskEnableLacrosDescription[] =
      "Chrome OS. When disabled, the Ash-chrome will be used";
  #endif  // BUILDFLAG(IS_CHROMEOS_ASH)
  
@@ -1354,7 +1349,7 @@ diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descripti
 diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
 --- a/chrome/browser/flag_descriptions.h
 +++ b/chrome/browser/flag_descriptions.h
-@@ -3162,6 +3162,9 @@ extern const char kWebKioskEnableLacrosName[];
+@@ -3222,6 +3222,9 @@ extern const char kWebKioskEnableLacrosName[];
  extern const char kWebKioskEnableLacrosDescription[];
  #endif  // BUILDFLAG(IS_CHROMEOS_ASH)
  
@@ -1367,15 +1362,15 @@ diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptio
 diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc
 --- a/chrome/browser/flags/android/chrome_feature_list.cc
 +++ b/chrome/browser/flags/android/chrome_feature_list.cc
-@@ -165,6 +165,7 @@ const base::Feature* const kFeaturesExposedToJava[] = {
+@@ -166,6 +166,7 @@ const base::Feature* const kFeaturesExposedToJava[] = {
+     &kAppToWebAttribution,
      &kBackgroundThreadPool,
-     &kBentoOffline,
      &kBookmarkBottomSheet,
 +    &kBookmarksExportUseSaf,
      &kCastDeviceFilter,
      &kCloseTabSuggestions,
      &kCriticalPersistedTabData,
-@@ -812,6 +813,10 @@ const base::Feature kWebApkInstallCompleteNotification{
+@@ -834,6 +835,10 @@ const base::Feature kWebApkInstallCompleteNotification{
  const base::Feature kWebApkTrampolineOnInitialIntent{
      "WebApkTrampolineOnInitialIntent", base::FEATURE_ENABLED_BY_DEFAULT};
  
@@ -1389,7 +1384,7 @@ diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browse
 diff --git a/chrome/browser/flags/android/chrome_feature_list.h b/chrome/browser/flags/android/chrome_feature_list.h
 --- a/chrome/browser/flags/android/chrome_feature_list.h
 +++ b/chrome/browser/flags/android/chrome_feature_list.h
-@@ -146,6 +146,7 @@ extern const base::Feature kToolbarMicIphAndroid;
+@@ -153,6 +153,7 @@ extern const base::Feature kToolbarMicIphAndroid;
  extern const base::Feature kToolbarUseHardwareBitmapDraw;
  extern const base::Feature kTrustedWebActivityLocationDelegation;
  extern const base::Feature kTrustedWebActivityNewDisclosure;
@@ -1400,7 +1395,7 @@ diff --git a/chrome/browser/flags/android/chrome_feature_list.h b/chrome/browser
 diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
 --- a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
 +++ b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
-@@ -546,6 +546,7 @@ public abstract class ChromeFeatureList {
+@@ -553,6 +553,7 @@ public abstract class ChromeFeatureList {
              "WebApkTrampolineOnInitialIntent";
      public static final String XSURFACE_METRICS_REPORTING = "XsurfaceMetricsReporting";
      public static final String WEB_OTP_CROSS_DEVICE_SIMPLE_STRING = "WebOtpCrossDeviceSimpleString";
@@ -1447,14 +1442,14 @@ diff --git a/chrome/browser/importer/profile_writer.h b/chrome/browser/importer/
 --- a/chrome/browser/importer/profile_writer.h
 +++ b/chrome/browser/importer/profile_writer.h
 @@ -11,6 +11,7 @@
- #include "base/macros.h"
+ #include "base/memory/raw_ptr.h"
  #include "base/memory/ref_counted.h"
  #include "build/build_config.h"
 +#include "components/bookmarks/browser/bookmark_model.h"
  #include "components/favicon_base/favicon_usage_data.h"
  #include "components/history/core/browser/history_types.h"
  #include "components/search_engines/template_url_service.h"
-@@ -68,6 +69,11 @@ class ProfileWriter : public base::RefCountedThreadSafe<ProfileWriter> {
+@@ -71,6 +72,11 @@ class ProfileWriter : public base::RefCountedThreadSafe<ProfileWriter> {
    virtual void AddBookmarks(const std::vector<ImportedBookmarkEntry>& bookmarks,
                              const std::u16string& top_level_folder_name);
  
@@ -1469,7 +1464,7 @@ diff --git a/chrome/browser/importer/profile_writer.h b/chrome/browser/importer/
 diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java
 --- a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java
 +++ b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java
-@@ -124,6 +124,8 @@ public final class ChromePreferenceKeys {
+@@ -122,6 +122,8 @@ public final class ChromePreferenceKeys {
      public static final String BOOKMARKS_LAST_USED_URL = "enhanced_bookmark_last_used_url";
      public static final String BOOKMARKS_LAST_USED_PARENT =
              "enhanced_bookmark_last_used_parent_folder";
@@ -1478,7 +1473,7 @@ diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/bro
  
      /**
       * Whether Chrome is set as the default browser.
-@@ -1059,6 +1061,7 @@ public final class ChromePreferenceKeys {
+@@ -1049,6 +1051,7 @@ public final class ChromePreferenceKeys {
                  AUTOFILL_ASSISTANT_PROACTIVE_HELP,
                  APP_LAUNCH_LAST_KNOWN_ACTIVE_TAB_STATE,
                  APP_LAUNCH_SEARCH_ENGINE_HAD_LOGO,
@@ -1517,7 +1512,7 @@ diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chro
 diff --git a/chrome/common/BUILD.gn b/chrome/common/BUILD.gn
 --- a/chrome/common/BUILD.gn
 +++ b/chrome/common/BUILD.gn
-@@ -412,6 +412,9 @@ static_library("common") {
+@@ -413,6 +413,9 @@ static_library("common") {
      sources += [
        "media/chrome_media_drm_bridge_client.cc",
        "media/chrome_media_drm_bridge_client.h",
@@ -1539,7 +1534,7 @@ diff --git a/chrome/utility/BUILD.gn b/chrome/utility/BUILD.gn
        "importer/bookmarks_file_importer.cc",
        "importer/bookmarks_file_importer.h",
        "importer/external_process_importer_bridge.cc",
-@@ -185,6 +183,11 @@ static_library("utility") {
+@@ -187,6 +185,11 @@ static_library("utility") {
      }
    }
  
@@ -1744,7 +1739,7 @@ diff --git a/ui/android/java/strings/android_ui_strings.grd b/ui/android/java/st
 diff --git a/ui/shell_dialogs/select_file_dialog.h b/ui/shell_dialogs/select_file_dialog.h
 --- a/ui/shell_dialogs/select_file_dialog.h
 +++ b/ui/shell_dialogs/select_file_dialog.h
-@@ -202,6 +202,8 @@ class SHELL_DIALOGS_EXPORT SelectFileDialog
+@@ -205,6 +205,8 @@ class SHELL_DIALOGS_EXPORT SelectFileDialog
                    void* params);
    bool HasMultipleFileTypeChoices();
  
@@ -1772,7 +1767,7 @@ diff --git a/ui/shell_dialogs/select_file_dialog_android.cc b/ui/shell_dialogs/s
 diff --git a/ui/shell_dialogs/select_file_dialog_android.h b/ui/shell_dialogs/select_file_dialog_android.h
 --- a/ui/shell_dialogs/select_file_dialog_android.h
 +++ b/ui/shell_dialogs/select_file_dialog_android.h
-@@ -55,6 +55,8 @@ class SelectFileDialogImpl : public SelectFileDialog {
+@@ -57,6 +57,8 @@ class SelectFileDialogImpl : public SelectFileDialog {
                        gfx::NativeWindow owning_window,
                        void* params) override;
  
@@ -1781,6 +1776,5 @@ diff --git a/ui/shell_dialogs/select_file_dialog_android.h b/ui/shell_dialogs/se
   protected:
    ~SelectFileDialogImpl() override;
  
--- 
-2.20.1
-
+--
+2.25.1

+ 16 - 17
build/patches/Add-custom-tab-intents-privacy-option.patch

@@ -20,7 +20,7 @@ See also: https://github.com/bromite/bromite/issues/1474
 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
-@@ -60,6 +60,16 @@
+@@ -65,6 +65,16 @@
          android:fragment="org.chromium.chrome.browser.privacy.settings.DoNotTrackSettings"
          android:key="do_not_track"
          android:title="@string/do_not_track_title"/>
@@ -123,9 +123,9 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/Inco
 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
 --- a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
 +++ b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
-@@ -90,6 +90,9 @@ public class PrivacySettings
- 
+@@ -94,6 +94,9 @@ public class PrivacySettings
      private ManagedPreferenceDelegate mManagedPreferenceDelegate;
+     private IncognitoLockSettings mIncognitoLockSettings;
  
 +    private ChromeSwitchPreference allowCustomTabIntentsPref;
 +    private ChromeSwitchPreference openExternalLinksPref;
@@ -133,8 +133,8 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting
      @Override
      public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
          PrivacyPreferencesManagerImpl privacyPrefManager =
-@@ -190,6 +193,9 @@ public class PrivacySettings
-         updateSummaries();
+@@ -203,6 +206,9 @@ public class PrivacySettings
+         updatePreferences();
      }
  
 +    public static final String PREF_ALLOW_CUSTOM_TAB_INTENTS = "allow_custom_tab_intents";
@@ -143,10 +143,10 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting
      @Override
      public boolean onPreferenceChange(Preference preference, Object newValue) {
          String key = preference.getKey();
-@@ -221,6 +227,14 @@ public class PrivacySettings
-         } else if (PREF_INCOGNITO_TAB_HISTORY_ENABLED.equals(key)) {
-             UserPrefs.get(Profile.getLastUsedRegularProfile())
-                     .setBoolean(Pref.INCOGNITO_TAB_HISTORY_ENABLED, (boolean) newValue);
+@@ -220,6 +226,14 @@ public class PrivacySettings
+             SharedPreferences.Editor sharedPreferenceEditor = ContextUtils.getAppSharedPreferences().edit();
+             sharedPreferenceEditor.putBoolean(PREF_FORCE_NO_JIT, (boolean) newValue);
+             sharedPreferenceEditor.apply();
 +        } else if (PREF_ALLOW_CUSTOM_TAB_INTENTS.equals(key)) {
 +            SharedPreferences.Editor sharedPreferencesEditor = ContextUtils.getAppSharedPreferences().edit();
 +            sharedPreferencesEditor.putBoolean(PREF_ALLOW_CUSTOM_TAB_INTENTS, (boolean)newValue);
@@ -155,10 +155,10 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting
 +            SharedPreferences.Editor sharedPreferencesEditor = ContextUtils.getAppSharedPreferences().edit();
 +            sharedPreferencesEditor.putBoolean(PREF_OPEN_EXTERNAL_LINKS_INCOGNITO, (boolean)newValue);
 +            sharedPreferencesEditor.apply();
-         }
- 
-         return true;
-@@ -256,6 +270,16 @@ public class PrivacySettings
+         } else if (PREF_AUTOFILL_ASSISTANT.equals(key)) {
+             mSharedPreferencesManager.writeBoolean(
+                  ChromePreferenceKeys.AUTOFILL_ASSISTANT_ENABLED, (boolean) newValue);
+@@ -255,6 +269,16 @@ public class PrivacySettings
              canMakePaymentPref.setChecked(prefService.getBoolean(Pref.CAN_MAKE_PAYMENT_ENABLED));
          }
  
@@ -194,7 +194,7 @@ diff --git a/chrome/browser/tab/java/src/org/chromium/chrome/browser/tab/TabAsso
 diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
 --- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
 +++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
-@@ -4555,6 +4555,21 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
+@@ -4780,6 +4780,21 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
        <message name="IDS_NEAR_OOM_REDUCTION_DECLINE" desc="The text of the button letting the user decline the browser's intervention, so that the page can be reloaded.">
           Show original
        </message>
@@ -216,6 +216,5 @@ diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chro
  
        <!-- Autofill Assistant preferences -->
        <!-- TODO(b/168178344): Move to Assistant settings strings section below. -->
--- 
-2.20.1
-
+--
+2.25.1

+ 33 - 14
build/patches/Add-exit-menu-item.patch

@@ -5,16 +5,17 @@ Subject: Add exit menu item
 Corrected Exit functionality
 ---
  chrome/android/java/res/menu/main_menu.xml                  | 6 ++++++
+ .../org/chromium/chrome/browser/ApplicationLifetime.java    | 2 ++
  .../org/chromium/chrome/browser/ChromeTabbedActivity.java   | 4 ++++
  .../src/org/chromium/chrome/browser/app/ChromeActivity.java | 6 ++++++
  .../chrome/browser/init/ChromeLifetimeController.java       | 6 +++++-
  .../browser/ui/android/strings/android_chrome_strings.grd   | 3 +++
- 5 files changed, 24 insertions(+), 1 deletion(-)
+ 6 files changed, 26 insertions(+), 1 deletion(-)
 
 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
 +++ b/chrome/android/java/res/menu/main_menu.xml
-@@ -124,6 +124,9 @@
+@@ -153,6 +153,9 @@
              android:icon="@drawable/gm_filled_cardboard_24" />
          <item android:id="@+id/managed_by_menu_id"
              android:title="@string/managed" />
@@ -24,7 +25,7 @@ diff --git a/chrome/android/java/res/menu/main_menu.xml b/chrome/android/java/re
      </group>
  
      <!-- Items shown only in the tab switcher -->
-@@ -150,6 +153,9 @@
+@@ -179,6 +182,9 @@
          <item android:id="@id/preferences_id"
              android:title="@string/menu_settings"
              android:icon="@drawable/settings_cog" />
@@ -33,11 +34,30 @@ diff --git a/chrome/android/java/res/menu/main_menu.xml b/chrome/android/java/re
 +            android:icon="@drawable/ic_exit_to_app_white_24dp" />
      </group>
  
-     <!-- Items shown only in the tab switcher when start surface is enabled -->
+     <!-- Items shown only when the tablet has no visible tabs -->
+diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ApplicationLifetime.java b/chrome/android/java/src/org/chromium/chrome/browser/ApplicationLifetime.java
+--- a/chrome/android/java/src/org/chromium/chrome/browser/ApplicationLifetime.java
++++ b/chrome/android/java/src/org/chromium/chrome/browser/ApplicationLifetime.java
+@@ -6,6 +6,7 @@ package org.chromium.chrome.browser;
+ 
+ import org.chromium.base.ObserverList;
+ import org.chromium.base.annotations.CalledByNative;
++import org.chromium.chrome.browser.incognito.IncognitoNotificationManager;
+ 
+ /**
+  * Watches for when Chrome is told to restart itself.
+@@ -42,6 +43,7 @@ public class ApplicationLifetime {
+ 
+     @CalledByNative
+     public static void terminate(boolean restart) {
++        IncognitoNotificationManager.dismissIncognitoNotification();
+         for (Observer observer : sObservers) {
+             observer.onTerminate(restart);
+         }
 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
 +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
-@@ -208,6 +208,8 @@ import java.util.HashSet;
+@@ -207,6 +207,8 @@ import java.util.HashSet;
  import java.util.List;
  import java.util.Locale;
  
@@ -46,7 +66,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedAct
  /**
   * This is the main activity for ChromeMobile when not running in document mode.  All the tabs
   * are accessible via a chrome specific tab switching UI.
-@@ -2028,6 +2030,8 @@ public class ChromeTabbedActivity extends ChromeActivity<ChromeActivityComponent
+@@ -2042,6 +2044,8 @@ public class ChromeTabbedActivity extends ChromeActivity<ChromeActivityComponent
          } else if (id == R.id.close_tab) {
              getCurrentTabModel().closeTab(currentTab, true, false, true);
              RecordUserAction.record("MobileTabClosed");
@@ -58,7 +78,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedAct
 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
 --- a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
 +++ b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
-@@ -66,6 +66,7 @@ import org.chromium.chrome.R;
+@@ -65,6 +65,7 @@ import org.chromium.chrome.R;
  import org.chromium.chrome.browser.ActivityTabProvider;
  import org.chromium.chrome.browser.ActivityUtils;
  import org.chromium.chrome.browser.AppHooks;
@@ -66,7 +86,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActiv
  import org.chromium.chrome.browser.ChromeActivitySessionTracker;
  import org.chromium.chrome.browser.ChromeApplicationImpl;
  import org.chromium.chrome.browser.ChromeKeyboardVisibilityDelegate;
-@@ -2309,6 +2310,11 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
+@@ -2388,6 +2389,11 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
              return true;
          }
  
@@ -97,9 +117,9 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeLife
 diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
 --- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
 +++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
-@@ -3193,6 +3193,9 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
-       <message name="IDS_MENU_REQUEST_DESKTOP_SITE_OFF" desc="Accessibility description for when Request Desktop Site is disabled.">
-         Turn on Request desktop site
+@@ -3338,6 +3338,9 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
+       <message name="IDS_MENU_AUTO_DARK_WEB_CONTENTS" desc="Menu item in Chrome's overflow/options menu. When Chrome's browser UI is set to dark theme and this option is checked, sites will have a dark theme automatically applied as well. [CHAR_LIMIT=24]">
+         Dark theme
        </message>
 +      <message name="IDS_MENU_EXIT" desc="Menu item for exit browser. [CHAR-LIMIT=27]">
 +        Exit
@@ -107,6 +127,5 @@ diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chro
        <message name="IDS_MENU_READER_MODE_PREFS" desc="Menu item to show reader mode preferences pane, which allows users to change the appearance (font size, theme, etc.) of the page. [CHAR_LIMIT=27]">
          Appearance
        </message>
--- 
-2.20.1
-
+--
+2.25.1

+ 8 - 9
build/patches/Add-flag-for-omnibox-autocomplete-filtering.patch

@@ -15,7 +15,7 @@ and internal chrome:// pages will be used for the autocomplete results.
 diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
 --- a/chrome/browser/about_flags.cc
 +++ b/chrome/browser/about_flags.cc
-@@ -456,6 +456,22 @@ const FeatureEntry::FeatureVariation kReaderModeDiscoverabilityVariations[] = {
+@@ -447,6 +447,22 @@ const FeatureEntry::FeatureVariation kReaderModeDiscoverabilityVariations[] = {
       base::size(kReaderModeOfferInSettings), nullptr}};
  #endif  // OS_ANDROID
  
@@ -38,7 +38,7 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
  #if defined(OS_ANDROID)
  const FeatureEntry::FeatureParam kAdaptiveButton_AlwaysNone[] = {
      {"mode", "always-none"}};
-@@ -4973,6 +4989,11 @@ const FeatureEntry kFeatureEntries[] = {
+@@ -4925,6 +4941,11 @@ const FeatureEntry kFeatureEntries[] = {
       FEATURE_VALUE_TYPE(chrome::android::kReaderModeInCCT)},
  #endif  // !defined(OS_ANDROID)
  
@@ -48,7 +48,7 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
 +     kOsAll, MULTI_VALUE_TYPE(kOmniboxAutocompleteFiltering)},
 +
  #if defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) || \
-     defined(OS_CHROMEOS)
+     defined(OS_CHROMEOS) || defined(OS_FUCHSIA)
      {"webui-feedback", flag_descriptions::kWebuiFeedbackName,
 diff --git a/components/omnibox/browser/autocomplete_controller.cc b/components/omnibox/browser/autocomplete_controller.cc
 --- a/components/omnibox/browser/autocomplete_controller.cc
@@ -62,7 +62,7 @@ diff --git a/components/omnibox/browser/autocomplete_controller.cc b/components/
  #include "base/feature_list.h"
  #include "base/format_macros.h"
  #include "base/metrics/histogram.h"
-@@ -276,6 +278,15 @@ AutocompleteController::AutocompleteController(
+@@ -270,6 +272,15 @@ AutocompleteController::AutocompleteController(
        search_service_worker_signal_sent_(false),
        template_url_service_(provider_client_->GetTemplateURLService()) {
    provider_types &= ~OmniboxFieldTrial::GetDisabledProviderTypes();
@@ -81,7 +81,7 @@ diff --git a/components/omnibox/browser/autocomplete_controller.cc b/components/
 diff --git a/components/omnibox/browser/history_url_provider.cc b/components/omnibox/browser/history_url_provider.cc
 --- a/components/omnibox/browser/history_url_provider.cc
 +++ b/components/omnibox/browser/history_url_provider.cc
-@@ -551,6 +551,9 @@ void HistoryURLProvider::Start(const AutocompleteInput& input,
+@@ -552,6 +552,9 @@ void HistoryURLProvider::Start(const AutocompleteInput& input,
    if (fixed_up_input.type() != metrics::OmniboxInputType::QUERY)
      matches_.push_back(what_you_typed_match);
  
@@ -102,7 +102,7 @@ diff --git a/components/omnibox/browser/search_provider.cc b/components/omnibox/
  #include "base/feature_list.h"
  #include "base/i18n/break_iterator.h"
  #include "base/i18n/case_conversion.h"
-@@ -647,6 +648,9 @@ void SearchProvider::Run(bool query_is_private) {
+@@ -646,6 +647,9 @@ void SearchProvider::Run(bool query_is_private) {
  }
  
  void SearchProvider::DoHistoryQuery(bool minimal_changes) {
@@ -133,6 +133,5 @@ diff --git a/components/url_formatter/url_fixer.cc b/components/url_formatter/ur
        url.append(kChromeUIDefaultHost);
      FixupPort(trimmed, parts.port, &url);
      FixupPath(trimmed, parts.path, &url);
--- 
-2.20.1
-
+--
+2.25.1

+ 7 - 8
build/patches/Add-flag-for-save-data-header.patch

@@ -14,7 +14,7 @@ Subject: Add flag for save-data-header
 diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
 --- a/chrome/browser/about_flags.cc
 +++ b/chrome/browser/about_flags.cc
-@@ -4700,6 +4700,9 @@ const FeatureEntry kFeatureEntries[] = {
+@@ -4660,6 +4660,9 @@ const FeatureEntry kFeatureEntries[] = {
  #endif  // BUILDFLAG(IS_CHROMEOS_ASH)
  
  #if defined(OS_ANDROID)
@@ -27,7 +27,7 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
 diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
 --- a/chrome/browser/flag_descriptions.cc
 +++ b/chrome/browser/flag_descriptions.cc
-@@ -1058,6 +1058,10 @@ const char kDisableKeepaliveFetchDescription[] =
+@@ -1093,6 +1093,10 @@ const char kDisableKeepaliveFetchDescription[] =
      "Disable fetch with keepalive set "
      "(https://fetch.spec.whatwg.org/#request-keepalive-flag).";
  
@@ -41,7 +41,7 @@ diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descripti
 diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
 --- a/chrome/browser/flag_descriptions.h
 +++ b/chrome/browser/flag_descriptions.h
-@@ -583,6 +583,9 @@ extern const char kDiagnosticsAppNavigationDescription[];
+@@ -596,6 +596,9 @@ extern const char kDiagnosticsAppNavigationDescription[];
  extern const char kDisableKeepaliveFetchName[];
  extern const char kDisableKeepaliveFetchDescription[];
  
@@ -70,7 +70,7 @@ diff --git a/content/browser/loader/browser_initiated_resource_request.cc b/cont
 diff --git a/services/network/public/cpp/features.cc b/services/network/public/cpp/features.cc
 --- a/services/network/public/cpp/features.cc
 +++ b/services/network/public/cpp/features.cc
-@@ -140,6 +140,10 @@ const base::FeatureParam<std::string>
+@@ -134,6 +134,10 @@ const base::FeatureParam<std::string>
                                                 "DisabledProviders", ""};
  
  // Disable special treatment on requests with keepalive set (see
@@ -84,7 +84,7 @@ diff --git a/services/network/public/cpp/features.cc b/services/network/public/c
 diff --git a/services/network/public/cpp/features.h b/services/network/public/cpp/features.h
 --- a/services/network/public/cpp/features.h
 +++ b/services/network/public/cpp/features.h
-@@ -54,6 +54,8 @@ extern const base::FeatureParam<std::string>
+@@ -52,6 +52,8 @@ extern const base::FeatureParam<std::string>
  COMPONENT_EXPORT(NETWORK_CPP)
  extern const base::Feature kDisableKeepaliveFetch;
  
@@ -93,6 +93,5 @@ diff --git a/services/network/public/cpp/features.h b/services/network/public/cp
  COMPONENT_EXPORT(NETWORK_CPP)
  extern const base::Feature kTrustTokens;
  
--- 
-2.20.1
-
+--
+2.25.1

+ 11 - 12
build/patches/Add-flag-to-configure-maximum-connections-per-host.patch

@@ -19,7 +19,7 @@ with limited CPU/memory resources and it is disabled by default.
 diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
 --- a/chrome/browser/about_flags.cc
 +++ b/chrome/browser/about_flags.cc
-@@ -868,6 +868,11 @@ const FeatureEntry::Choice kForceEffectiveConnectionTypeChoices[] = {
+@@ -817,6 +817,11 @@ const FeatureEntry::Choice kForceEffectiveConnectionTypeChoices[] = {
       net::kEffectiveConnectionType4G},
  };
  
@@ -31,7 +31,7 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
  // Ensure that all effective connection types returned by Network Quality
  // Estimator (NQE) are also exposed via flags.
  static_assert(net::EFFECTIVE_CONNECTION_TYPE_LAST + 2 ==
-@@ -3974,6 +3979,9 @@ const FeatureEntry kFeatureEntries[] = {
+@@ -3923,6 +3928,9 @@ const FeatureEntry kFeatureEntries[] = {
       flag_descriptions::kAndroidPictureInPictureAPIName,
       flag_descriptions::kAndroidPictureInPictureAPIDescription, kOsAndroid,
       FEATURE_VALUE_TYPE(media::kPictureInPictureAPI)},
@@ -44,9 +44,9 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
 diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
 --- a/chrome/browser/flag_descriptions.cc
 +++ b/chrome/browser/flag_descriptions.cc
-@@ -1572,6 +1572,10 @@ const char kMediaHistoryDescription[] =
-     "Enables Media History which records data around media playbacks on "
-     "websites.";
+@@ -1588,6 +1588,10 @@ const char kLogJsConsoleMessagesDescription[] =
+     "Enable logging JS console messages in system logs, please note that they "
+     "may contain PII.";
  
 +const char kMaxConnectionsPerHostName[] = "Maximum connections per host";
 +const char kMaxConnectionsPerHostDescription[] =
@@ -58,9 +58,9 @@ diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descripti
 diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
 --- a/chrome/browser/flag_descriptions.h
 +++ b/chrome/browser/flag_descriptions.h
-@@ -905,6 +905,9 @@ extern const char kLogJsConsoleMessagesDescription[];
- extern const char kMediaHistoryName[];
- extern const char kMediaHistoryDescription[];
+@@ -919,6 +919,9 @@ extern const char kLensCameraAssistedSearchDescription[];
+ extern const char kLogJsConsoleMessagesName[];
+ extern const char kLogJsConsoleMessagesDescription[];
  
 +extern const char kMaxConnectionsPerHostName[];
 +extern const char kMaxConnectionsPerHostDescription[];
@@ -110,7 +110,7 @@ diff --git a/components/network_session_configurator/common/network_switch_list.
 diff --git a/components/url_formatter/spoof_checks/top_domains/BUILD.gn b/components/url_formatter/spoof_checks/top_domains/BUILD.gn
 --- a/components/url_formatter/spoof_checks/top_domains/BUILD.gn
 +++ b/components/url_formatter/spoof_checks/top_domains/BUILD.gn
-@@ -73,6 +73,7 @@ executable("make_top_domain_list_variables") {
+@@ -89,6 +89,7 @@ executable("make_top_domain_list_variables") {
      "//base:i18n",
      "//components/url_formatter/spoof_checks/common_words:common",
      "//third_party/icu",
@@ -152,6 +152,5 @@ diff --git a/net/socket/client_socket_pool_manager.cc b/net/socket/client_socket
    return g_max_sockets_per_group[pool_type];
  }
  
--- 
-2.20.1
-
+--
+2.25.1

+ 7 - 8
build/patches/Add-flag-to-control-video-playback-resume-feature.patch

@@ -13,7 +13,7 @@ Disable it by default on Android as it is everywhere else
 diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
 --- a/chrome/browser/about_flags.cc
 +++ b/chrome/browser/about_flags.cc
-@@ -2837,6 +2837,10 @@ const FeatureEntry kFeatureEntries[] = {
+@@ -2714,6 +2714,10 @@ const FeatureEntry kFeatureEntries[] = {
       flag_descriptions::kWebRtcRemoteEventLogName,
       flag_descriptions::kWebRtcRemoteEventLogDescription, kOsDesktop,
       FEATURE_VALUE_TYPE(features::kWebRtcRemoteEventLog)},
@@ -27,7 +27,7 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
 diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
 --- a/chrome/browser/flag_descriptions.cc
 +++ b/chrome/browser/flag_descriptions.cc
-@@ -1143,6 +1143,11 @@ const char kEnablePenetratingImageSelectionDescription[] =
+@@ -1182,6 +1182,11 @@ const char kEnablePenetratingImageSelectionDescription[] =
      "Enables image options to be surfaced in the context menu for nodes "
      "covered by transparent overlays.";
  
@@ -42,7 +42,7 @@ diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descripti
 diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
 --- a/chrome/browser/flag_descriptions.h
 +++ b/chrome/browser/flag_descriptions.h
-@@ -648,6 +648,9 @@ extern const char kEnablePortalsDescription[];
+@@ -670,6 +670,9 @@ extern const char kEnablePortalsDescription[];
  extern const char kEnablePortalsCrossOriginName[];
  extern const char kEnablePortalsCrossOriginDescription[];
  
@@ -55,7 +55,7 @@ diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptio
 diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc
 --- a/media/base/media_switches.cc
 +++ b/media/base/media_switches.cc
-@@ -276,11 +276,7 @@ const base::Feature kPreloadMetadataLazyLoad{"PreloadMetadataLazyLoad",
+@@ -283,11 +283,7 @@ const base::Feature kPreloadMetadataLazyLoad{"PreloadMetadataLazyLoad",
  // when in background.
  const base::Feature kResumeBackgroundVideo {
    "resume-background-video",
@@ -67,7 +67,6 @@ diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc
 +   base::FEATURE_DISABLED_BY_DEFAULT
  };
  
- // When enabled, MediaCapabilities will check with GPU Video Accelerator
--- 
-2.20.1
-
+ // Experimental: Try to avoid destroying the media player when transferring a
+--
+2.25.1

+ 10 - 11
build/patches/Add-flag-to-disable-IPv6-probes.patch

@@ -16,9 +16,9 @@ Subject: Add flag to disable IPv6 probes
 diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
 --- a/chrome/browser/about_flags.cc
 +++ b/chrome/browser/about_flags.cc
-@@ -4949,6 +4949,11 @@ const FeatureEntry kFeatureEntries[] = {
+@@ -4904,6 +4904,11 @@ const FeatureEntry kFeatureEntries[] = {
  #endif  // defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX) ||
-         // defined(OS_CHROMEOS)
+         // defined(OS_CHROMEOS) || defined(OS_FUCHSIA)
  
 +    {"ipv6-probing",
 +     flag_descriptions::kIPv6ProbingName,
@@ -31,7 +31,7 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
 diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
 --- a/chrome/browser/flag_descriptions.cc
 +++ b/chrome/browser/flag_descriptions.cc
-@@ -3070,6 +3070,10 @@ const char kContextualSearchRankerQueryDescription[] =
+@@ -3053,6 +3053,10 @@ const char kContextualSearchRankerQueryDescription[] =
  
  const char kContextualSearchSecondTapName[] =
      "Contextual Search second tap triggering";
@@ -45,7 +45,7 @@ diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descripti
 diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
 --- a/chrome/browser/flag_descriptions.h
 +++ b/chrome/browser/flag_descriptions.h
-@@ -711,6 +711,9 @@ extern const char kEnableWasmLazyCompilationName[];
+@@ -733,6 +733,9 @@ extern const char kEnableWasmLazyCompilationName[];
  extern const char kEnableWasmLazyCompilationDescription[];
  
  extern const char kEnableWasmTieringName[];
@@ -88,7 +88,7 @@ diff --git a/components/subresource_filter/tools/BUILD.gn b/components/subresour
 diff --git a/components/url_formatter/spoof_checks/top_domains/BUILD.gn b/components/url_formatter/spoof_checks/top_domains/BUILD.gn
 --- a/components/url_formatter/spoof_checks/top_domains/BUILD.gn
 +++ b/components/url_formatter/spoof_checks/top_domains/BUILD.gn
-@@ -73,7 +73,8 @@ executable("make_top_domain_list_variables") {
+@@ -89,7 +89,8 @@ executable("make_top_domain_list_variables") {
      "//base:i18n",
      "//components/url_formatter/spoof_checks/common_words:common",
      "//third_party/icu",
@@ -101,7 +101,7 @@ diff --git a/components/url_formatter/spoof_checks/top_domains/BUILD.gn b/compon
 diff --git a/net/dns/host_resolver_manager.cc b/net/dns/host_resolver_manager.cc
 --- a/net/dns/host_resolver_manager.cc
 +++ b/net/dns/host_resolver_manager.cc
-@@ -88,6 +88,7 @@
+@@ -95,6 +95,7 @@
  #include "net/log/net_log_event_type.h"
  #include "net/log/net_log_source.h"
  #include "net/log/net_log_source_type.h"
@@ -109,7 +109,7 @@ diff --git a/net/dns/host_resolver_manager.cc b/net/dns/host_resolver_manager.cc
  #include "net/log/net_log_with_source.h"
  #include "net/socket/client_socket_factory.h"
  #include "net/socket/datagram_client_socket.h"
-@@ -3692,8 +3693,14 @@ bool HostResolverManager::IsIPv6Reachable(const NetLogWithSource& net_log) {
+@@ -3726,8 +3727,14 @@ bool HostResolverManager::IsIPv6Reachable(const NetLogWithSource& net_log) {
    if (last_ipv6_probe_time_.is_null() ||
        (tick_clock_->NowTicks() - last_ipv6_probe_time_).InMilliseconds() >
            kIPv6ProbePeriodMs) {
@@ -128,7 +128,7 @@ diff --git a/net/dns/host_resolver_manager.cc b/net/dns/host_resolver_manager.cc
 diff --git a/services/network/public/cpp/features.cc b/services/network/public/cpp/features.cc
 --- a/services/network/public/cpp/features.cc
 +++ b/services/network/public/cpp/features.cc
-@@ -42,6 +42,10 @@ const base::Feature kReporting{"Reporting", base::FEATURE_ENABLED_BY_DEFAULT};
+@@ -43,6 +43,10 @@ const base::Feature kReporting{"Reporting", base::FEATURE_ENABLED_BY_DEFAULT};
  const base::Feature kThrottleDelayable{"ThrottleDelayable",
                                         base::FEATURE_ENABLED_BY_DEFAULT};
  
@@ -151,6 +151,5 @@ diff --git a/services/network/public/cpp/features.h b/services/network/public/cp
  extern const base::Feature kReporting;
  COMPONENT_EXPORT(NETWORK_CPP)
  extern const base::Feature kThrottleDelayable;
--- 
-2.20.1
-
+--
+2.25.1

+ 10 - 11
build/patches/Add-flag-to-disable-WebGL.patch

@@ -11,7 +11,7 @@ Subject: Add flag to disable WebGL
 diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
 --- a/chrome/browser/about_flags.cc
 +++ b/chrome/browser/about_flags.cc
-@@ -2772,6 +2772,9 @@ const FeatureEntry::Choice kDocumentTransitionSlowdownFactorChoices[] = {
+@@ -2655,6 +2655,9 @@ const FeatureEntry::FeatureVariation kSnoopingProtectionVariations[] = {
  // When adding a new choice, add it to the end of the list.
  const FeatureEntry kFeatureEntries[] = {
  // Include generated flags for flag unexpiry; see //docs/flag_expiry.md and
@@ -24,21 +24,21 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
 diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
 --- a/chrome/browser/flag_descriptions.cc
 +++ b/chrome/browser/flag_descriptions.cc
-@@ -636,6 +636,10 @@ const char kEnableAudioFocusEnforcementName[] = "Audio Focus Enforcement";
- const char kEnableAudioFocusEnforcementDescription[] =
-     "Enables enforcement of a single media session having audio focus at "
-     "any one time. Requires #enable-media-session-service to be enabled too.";
+@@ -675,6 +675,10 @@ const char kDocumentTransitionSlowdownFactorName[] =
+ const char kDocumentTransitionSlowdownFactorDescription[] =
+     "Slows down animations triggered by documentTransition JavaScript API for "
+     "debugging.";
 +const char kDisableWebGLName[] = "WebGL";
 +
 +const char kDisableWebGLDescription[] = "Enable or disable all versions of WebGL";
 +
  
- const char kEnableAutofillAccountWalletStorageName[] =
-     "Enable the account data storage for autofill";
+ const char kEnableAutofillAddressSavePromptName[] =
+     "Autofill Address Save Prompts";
 diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
 --- a/chrome/browser/flag_descriptions.h
 +++ b/chrome/browser/flag_descriptions.h
-@@ -354,6 +354,9 @@ extern const char kForceColorProfileSRGB[];
+@@ -380,6 +380,9 @@ extern const char kForceColorProfileSRGB[];
  extern const char kForceColorProfileP3[];
  extern const char kForceColorProfileColorSpin[];
  extern const char kForceColorProfileSCRGBLinear[];
@@ -48,6 +48,5 @@ diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptio
  extern const char kForceColorProfileHDR10[];
  
  extern const char kForceColorProfileName[];
--- 
-2.20.1
-
+--
+2.25.1

+ 7 - 8
build/patches/Add-flag-to-disable-external-intent-requests.patch

@@ -11,7 +11,7 @@ Subject: Add flag to disable external intent requests
 diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
 --- a/chrome/browser/about_flags.cc
 +++ b/chrome/browser/about_flags.cc
-@@ -2826,6 +2826,9 @@ const FeatureEntry kFeatureEntries[] = {
+@@ -2709,6 +2709,9 @@ const FeatureEntry kFeatureEntries[] = {
       flag_descriptions::kWebrtcCaptureMultiChannelApmName,
       flag_descriptions::kWebrtcCaptureMultiChannelApmDescription, kOsAll,
       FEATURE_VALUE_TYPE(features::kWebRtcEnableCaptureMultiChannelApm)},
@@ -24,9 +24,9 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
 diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
 --- a/chrome/browser/flag_descriptions.cc
 +++ b/chrome/browser/flag_descriptions.cc
-@@ -3344,6 +3344,12 @@ const char kProcessSharingWithStrictSiteInstancesDescription[] =
-     "separated like strict site isolation, but process selection puts multiple "
-     "site instances in a single process.";
+@@ -3350,6 +3350,12 @@ const char kPhotoPickerVideoSupportName[] = "Photo Picker Video Support";
+ const char kPhotoPickerVideoSupportDescription[] =
+     "Enables video files to be shown in the Photo Picker dialog";
  
 +const char kDisableExternalIntentRequestsName[] =
 +    "Never forward URL requests to external intents";
@@ -40,7 +40,7 @@ diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descripti
 diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
 --- a/chrome/browser/flag_descriptions.h
 +++ b/chrome/browser/flag_descriptions.h
-@@ -1930,6 +1930,9 @@ extern const char kQueryTilesNTPDescription[];
+@@ -1946,6 +1946,9 @@ extern const char kQueryTilesNTPDescription[];
  extern const char kQueryTilesOmniboxName[];
  extern const char kQueryTilesOmniboxDescription[];
  extern const char kQueryTilesSingleTierName[];
@@ -50,6 +50,5 @@ diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptio
  extern const char kQueryTilesSingleTierDescription[];
  extern const char kQueryTilesEnableQueryEditingName[];
  extern const char kQueryTilesEnableQueryEditingDescription[];
--- 
-2.20.1
-
+--
+2.25.1

+ 21 - 21
build/patches/Add-flag-to-disable-vibration.patch

@@ -7,18 +7,18 @@ Subject: Add flag to disable vibration
  chrome/browser/flag_descriptions.cc                           | 3 +++
  chrome/browser/flag_descriptions.h                            | 3 +++
  content/child/runtime_features.cc                             | 1 +
- content/public/common/content_features.cc                     | 3 +++
+ content/public/common/content_features.cc                     | 4 ++++
  content/public/common/content_features.h                      | 2 ++
  third_party/blink/public/platform/web_runtime_features.h      | 1 +
  .../blink/renderer/modules/vibration/vibration_controller.cc  | 3 +++
  .../blink/renderer/platform/exported/web_runtime_features.cc  | 4 ++++
  .../blink/renderer/platform/runtime_enabled_features.json5    | 4 ++++
- 10 files changed, 28 insertions(+)
+ 10 files changed, 29 insertions(+)
 
 diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
 --- a/chrome/browser/about_flags.cc
 +++ b/chrome/browser/about_flags.cc
-@@ -6412,6 +6412,10 @@ const FeatureEntry kFeatureEntries[] = {
+@@ -6260,6 +6260,10 @@ const FeatureEntry kFeatureEntries[] = {
       FEATURE_VALUE_TYPE(features::kNewMacNotificationAPI)},
  #endif
  
@@ -32,8 +32,8 @@ diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
 diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
 --- a/chrome/browser/flag_descriptions.cc
 +++ b/chrome/browser/flag_descriptions.cc
-@@ -5242,6 +5242,9 @@ const char kDefaultMeetWebAppDescription[] =
-     "Enables the Meet web app to be installed by default.";
+@@ -5326,6 +5326,9 @@ const char kDefaultCalculatorWebAppDescription[] =
+     "chrome app.";
  #endif  // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
  
 +const char kEnableVibrationName[] = "Vibration";
@@ -45,8 +45,8 @@ diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descripti
 diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
 --- a/chrome/browser/flag_descriptions.h
 +++ b/chrome/browser/flag_descriptions.h
-@@ -3044,6 +3044,9 @@ extern const char kDefaultMeetWebAppName[];
- extern const char kDefaultMeetWebAppDescription[];
+@@ -3091,6 +3091,9 @@ extern const char kDefaultCalculatorWebAppName[];
+ extern const char kDefaultCalculatorWebAppDescription[];
  #endif  // BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_CHROMEOS_LACROS)
  
 +extern const char kEnableVibrationName[];
@@ -58,7 +58,7 @@ diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptio
 diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc
 --- a/content/child/runtime_features.cc
 +++ b/content/child/runtime_features.cc
-@@ -102,6 +102,7 @@ void SetRuntimeFeatureDefaultsForPlatform(
+@@ -103,6 +103,7 @@ void SetRuntimeFeatureDefaultsForPlatform(
  #if defined(OS_ANDROID)
    if (command_line.HasSwitch(switches::kDisableMediaSessionAPI))
      WebRuntimeFeatures::EnableMediaSession(false);
@@ -69,21 +69,22 @@ diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.
 diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc
 --- a/content/public/common/content_features.cc
 +++ b/content/public/common/content_features.cc
-@@ -103,6 +103,9 @@ const base::Feature kBackForwardCacheSameSiteForBots{
+@@ -113,6 +113,10 @@ const base::Feature kBackForwardCacheMemoryControls {
+ #endif
+ };
  
- // BackForwardCacheMemoryControls is enabled only on Android to disable
- // BackForwardCache for lower memory devices due to memory limiations.
 +// Enables vibration; an user gesture will still be required if enabled.
 +const base::Feature kVibration{"Vibration",
 +                                    base::FEATURE_DISABLED_BY_DEFAULT};
- const base::Feature kBackForwardCacheMemoryControls{
-   "BackForwardCacheMemoryControls",
- 
++
+ // When this feature is enabled, private network requests initiated from
+ // non-secure contexts in the `public` address space  are blocked.
+ //
 diff --git a/content/public/common/content_features.h b/content/public/common/content_features.h
 --- a/content/public/common/content_features.h
 +++ b/content/public/common/content_features.h
-@@ -273,6 +273,8 @@ CONTENT_EXPORT extern const base::Feature kWarmUpNetworkProcess;
- CONTENT_EXPORT extern const base::Feature kWebNfc;
+@@ -299,6 +299,8 @@ extern const char kBigLittleSchedulingGpuMainBigParam[];
+ 
  #endif  // defined(OS_ANDROID)
  
 +CONTENT_EXPORT extern const base::Feature kVibration;
@@ -125,7 +126,7 @@ diff --git a/third_party/blink/renderer/modules/vibration/vibration_controller.c
 diff --git a/third_party/blink/renderer/platform/exported/web_runtime_features.cc b/third_party/blink/renderer/platform/exported/web_runtime_features.cc
 --- a/third_party/blink/renderer/platform/exported/web_runtime_features.cc
 +++ b/third_party/blink/renderer/platform/exported/web_runtime_features.cc
-@@ -182,6 +182,10 @@ void WebRuntimeFeatures::EnableScrollTopLeftInterop(bool enable) {
+@@ -190,6 +190,10 @@ void WebRuntimeFeatures::EnableScrollTopLeftInterop(bool enable) {
    RuntimeEnabledFeatures::SetScrollTopLeftInteropEnabled(enable);
  }
  
@@ -139,7 +140,7 @@ diff --git a/third_party/blink/renderer/platform/exported/web_runtime_features.c
 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
-@@ -1575,6 +1575,10 @@
+@@ -1622,6 +1622,10 @@
        name: "OrientationEvent",
        status: {"Android": "stable"},
      },
@@ -150,6 +151,5 @@ diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5
      {
        name: "OriginIsolationHeader",
        status: "stable",
--- 
-2.20.1
-
+--
+2.25.1

+ 72 - 79
build/patches/Add-history-support-in-incognito-mode.patch

@@ -17,9 +17,9 @@ See also: https://github.com/bromite/bromite/pull/1427
  .../CustomTabAppMenuPropertiesDelegate.java   |   3 +
  .../browser/download/DownloadUtils.java       |  16 +-
  .../browser/history/HistoryManager.java       |  17 +-
- .../chrome/browser/history/HistoryPage.java   |  14 +
+ .../chrome/browser/history/HistoryPage.java   |  15 +
  .../chrome/browser/ntp/RecentTabsManager.java |   8 +-
- .../privacy/settings/PrivacySettings.java     |  18 +
+ .../privacy/settings/PrivacySettings.java     |  16 +
  .../browser/tab/HistoricalTabSaver.java       |  12 +-
  .../browser/tabmodel/TabPersistentStore.java  |   5 +-
  .../history/Bromite_HistoryManagerTest.java   | 112 ++++++
@@ -35,9 +35,9 @@ See also: https://github.com/bromite/bromite/pull/1427
  .../android/offline_page_bridge.cc            |  13 +-
  .../android/offline_page_model_factory.cc     |  21 +-
  .../android/request_coordinator_factory.cc    |  17 +
- .../offline_page_model_factory.h              |   2 +
+ .../offline_page_model_factory.h              |   1 +
  .../offline_pages/recent_tab_helper.cc        |  12 +
- .../request_coordinator_factory.h             |   3 +
+ .../request_coordinator_factory.h             |   2 +
  chrome/browser/prefs/browser_prefs.cc         |   3 +
  .../browser/ui/android/native_page/BUILD.gn   |   2 +
  .../browser/ui/native_page/NativePage.java    |   6 +-
@@ -46,7 +46,7 @@ See also: https://github.com/bromite/bromite/pull/1427
  chrome/common/pref_names.cc                   |   5 +
  chrome/common/pref_names.h                    |   4 +
  chrome/test/BUILD.gn                          |   5 +
- 36 files changed, 1046 insertions(+), 38 deletions(-)
+ 36 files changed, 1043 insertions(+), 38 deletions(-)
  create mode 100644 chrome/android/javatests/src/org/chromium/chrome/browser/history/Bromite_HistoryManagerTest.java
  create mode 100644 chrome/android/javatests/src/org/chromium/chrome/browser/privacy/settings/Bromite_PrivacySettingsFragmentTest_HistoryInAlwaysIncognito.java
  create mode 100644 chrome/android/junit/src/org/chromium/chrome/browser/app/appmenu/Bromite_AppMenuPropertiesDelegateUnitTest.java
@@ -56,7 +56,7 @@ See also: https://github.com/bromite/bromite/pull/1427
 diff --git a/chrome/android/chrome_junit_test_java_sources.gni b/chrome/android/chrome_junit_test_java_sources.gni
 --- a/chrome/android/chrome_junit_test_java_sources.gni
 +++ b/chrome/android/chrome_junit_test_java_sources.gni
-@@ -225,3 +225,7 @@ chrome_junit_test_java_sources = [
+@@ -231,3 +231,7 @@ chrome_junit_test_java_sources = [
    "junit/src/org/chromium/chrome/browser/webapps/WebappLauncherActivityTest.java",
    "junit/src/org/chromium/chrome/browser/webapps/WebappRegistryTest.java",
  ]
@@ -68,7 +68,7 @@ diff --git a/chrome/android/chrome_junit_test_java_sources.gni b/chrome/android/
 diff --git a/chrome/android/chrome_test_java_sources.gni b/chrome/android/chrome_test_java_sources.gni
 --- a/chrome/android/chrome_test_java_sources.gni
 +++ b/chrome/android/chrome_test_java_sources.gni
-@@ -649,3 +649,9 @@ chrome_test_java_sources = [
+@@ -661,3 +661,9 @@ chrome_test_java_sources = [
  if (enable_feed_v2) {
    chrome_test_java_sources += [ "javatests/src/org/chromium/chrome/browser/ntp/NewTabPageColorWithFeedV2Test.java" ]
  }
@@ -81,7 +81,7 @@ diff --git a/chrome/android/chrome_test_java_sources.gni b/chrome/android/chrome
 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
-@@ -46,6 +46,11 @@
+@@ -51,6 +51,11 @@
          android:title="@string/close_tabs_on_exit_title"
          android:summary="@string/close_tabs_on_exit_summary"
          android:defaultValue="false" />
@@ -96,9 +96,9 @@ diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/androi
 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateImpl.java
 --- a/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateImpl.java
 +++ b/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateImpl.java
-@@ -75,6 +75,10 @@ import java.lang.annotation.RetentionPolicy;
- import java.util.ArrayList;
+@@ -96,6 +96,10 @@ import java.util.ArrayList;
  import java.util.List;
+ import java.util.Map;
  
 +import org.chromium.components.prefs.PrefService;
 +import org.chromium.components.user_prefs.UserPrefs;
@@ -107,8 +107,8 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/App
  /**
   * Base implementation of {@link AppMenuPropertiesDelegate} that handles hiding and showing menu
   * items based on activity state.
-@@ -133,6 +137,13 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate
-     protected BookmarkBridge mBookmarkBridge;
+@@ -156,6 +160,13 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate
+     private @StartSurfaceState int mStartSurfaceState;
      protected Runnable mAppMenuInvalidator;
  
 +    private PrefService sPrefServiceForTest;
@@ -121,7 +121,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/App
      /**
       * Construct a new {@link AppMenuPropertiesDelegateImpl}.
       * @param context The activity context.
-@@ -379,7 +390,8 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate
+@@ -525,7 +536,8 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate
      }
  
      private void prepareCommonMenuItems(Menu menu, @MenuGroup int menuGroup, boolean isIncognito) {
@@ -131,7 +131,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/App
              final MenuItem newTabOption = menu.findItem(R.id.new_tab_menu_id);
              if (newTabOption != null)
                  newTabOption.setVisible(false);
-@@ -444,7 +456,15 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate
+@@ -587,7 +599,15 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate
              }
  
              if (item.getItemId() == R.id.recent_tabs_menu_id) {
@@ -148,7 +148,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/App
              }
              if (item.getItemId() == R.id.menu_group_tabs) {
                  item.setVisible(isMenuGroupTabsVisible);
-@@ -632,7 +652,10 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate
+@@ -824,7 +844,10 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate
          //                is not persisted when adding to the homescreen.
          // * If creating shortcuts it not supported by the current home screen.
          return WebappsUtils.isAddToHomeIntentSupported() && !isChromeScheme && !isFileScheme
@@ -163,7 +163,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/App
 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java
 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java
 +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java
-@@ -169,6 +169,9 @@ public class CustomTabAppMenuPropertiesDelegate extends AppMenuPropertiesDelegat
+@@ -168,6 +168,9 @@ public class CustomTabAppMenuPropertiesDelegate extends AppMenuPropertiesDelegat
                  downloadItemVisible = false;
                  openInChromeItemVisible = false;
              }
@@ -209,7 +209,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/download/Downlo
 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManager.java b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManager.java
 --- a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManager.java
 +++ b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryManager.java
-@@ -42,6 +42,12 @@ import org.chromium.ui.base.Clipboard;
+@@ -41,6 +41,12 @@ import org.chromium.ui.base.Clipboard;
  
  import java.util.List;
  
@@ -222,7 +222,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/history/History
  /**
   * Combines and manages the different UI components of browsing history.
   */
-@@ -216,7 +222,16 @@ public class HistoryManager implements OnMenuItemClickListener, SelectionObserve
+@@ -213,7 +219,16 @@ public class HistoryManager implements OnMenuItemClickListener, SelectionObserve
                                                  : mSelectableListLayout;
      }
  
@@ -243,7 +243,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/history/History
 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryPage.java b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryPage.java
 --- a/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryPage.java
 +++ b/chrome/android/java/src/org/chromium/chrome/browser/history/HistoryPage.java
-@@ -17,6 +17,12 @@ import org.chromium.chrome.browser.ui.native_page.BasicNativePage;
+@@ -16,6 +16,12 @@ import org.chromium.chrome.browser.ui.native_page.BasicNativePage;
  import org.chromium.chrome.browser.ui.native_page.NativePageHost;
  import org.chromium.components.embedder_support.util.UrlConstants;
  
@@ -256,8 +256,8 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/history/History
  /**
   * Native page for managing browsing history.
   */
-@@ -40,6 +46,14 @@ public class HistoryPage extends BasicNativePage {
-             boolean isIncognito, TabCreatorManager tabCreatorManager, Supplier<Tab> tabSupplier) {
+@@ -37,8 +43,17 @@ public class HistoryPage extends BasicNativePage {
+             boolean isIncognito, Supplier<Tab> tabSupplier) {
          super(host);
  
 +        if (isIncognito &&
@@ -268,13 +268,16 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/history/History
 +            if (historyEnabledInIncognito == true) isIncognito = false;
 +        }
 +
-         mHistoryManager = new HistoryManager(
-                 activity, false, snackbarManager, isIncognito, tabCreatorManager, tabSupplier);
+         mHistoryManager =
+                 new HistoryManager(activity, false, snackbarManager, isIncognito, tabSupplier);
++
          mTitle = host.getContext().getResources().getString(R.string.menu_history);
+ 
+         initWithView(mHistoryManager.getView());
 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentTabsManager.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentTabsManager.java
 --- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentTabsManager.java
 +++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentTabsManager.java
-@@ -86,15 +86,15 @@ public class RecentTabsManager implements SignInStateObserver,
+@@ -76,15 +76,15 @@ public class RecentTabsManager implements SignInStateObserver,
       */
      public RecentTabsManager(
              Tab tab, Profile profile, Context context, Runnable showHistoryManager) {
@@ -297,15 +300,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/RecentTabsM
 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
 --- a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
 +++ b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
-@@ -18,6 +18,7 @@ import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat;
- 
- import org.chromium.base.ContextUtils;
- import org.chromium.base.BuildInfo;
-+import org.chromium.base.Log;
- import org.chromium.chrome.R;
- import org.chromium.chrome.browser.feedback.HelpAndFeedbackLauncherImpl;
- import org.chromium.chrome.browser.flags.ChromeFeatureList;
-@@ -136,6 +137,11 @@ public class PrivacySettings
+@@ -150,6 +150,11 @@ public class PrivacySettings
          Preference secureDnsPref = findPreference(PREF_SECURE_DNS);
          secureDnsPref.setVisible(SecureDnsSettings.isUiEnabled());
  
@@ -314,40 +309,41 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting
 +        historyInIncognitoPref.setOnPreferenceChangeListener(this);
 +        historyInIncognitoPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
 +
-         updateSummaries();
+         updatePreferences();
      }
  
-@@ -158,11 +164,16 @@ public class PrivacySettings
+@@ -166,6 +171,9 @@ public class PrivacySettings
          } else if (PREF_HTTPS_FIRST_MODE.equals(key)) {
              UserPrefs.get(Profile.getLastUsedRegularProfile())
                      .setBoolean(Pref.HTTPS_ONLY_MODE_ENABLED, (boolean) newValue);
 +        } else if (PREF_INCOGNITO_TAB_HISTORY_ENABLED.equals(key)) {
 +            UserPrefs.get(Profile.getLastUsedRegularProfile())
 +                    .setBoolean(Pref.INCOGNITO_TAB_HISTORY_ENABLED, (boolean) newValue);
-         }
- 
+         } else if (PREF_ALWAYS_INCOGNITO.equals(key)) {
+             if (!mSnackbarManager.isShowing())
+                 mSnackbarManager.showSnackbar(mSnackbar);
+@@ -173,6 +181,7 @@ public class PrivacySettings
          return true;
      }
  
 +    public static final String PREF_INCOGNITO_TAB_HISTORY_ENABLED = "incognito_history_enabled";
-+
      @Override
      public void onResume() {
          super.onResume();
-@@ -203,6 +214,13 @@ public class PrivacySettings
-                 (ChromeSwitchPreference) findPreference(PREF_CLOSE_TABS_ON_EXIT);
-         closeTabsOnExitPref.setOnPreferenceChangeListener(this);
-         closeTabsOnExitPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
-+
+@@ -214,6 +223,13 @@ public class PrivacySettings
+                     PrivacySandboxSettingsFragment.getStatusString(getContext()));
+         }
+ 
 +        ChromeSwitchPreference historyInIncognitoPref =
 +                (ChromeSwitchPreference) findPreference(PREF_INCOGNITO_TAB_HISTORY_ENABLED);
 +        if (historyInIncognitoPref != null) {
 +            historyInIncognitoPref.setChecked(
 +                    prefService.getBoolean(Pref.INCOGNITO_TAB_HISTORY_ENABLED));
 +        }
++
+         mIncognitoLockSettings.updateIncognitoReauthPreferenceIfNeeded(getActivity());
      }
  
-     private ChromeManagedPreferenceDelegate createManagedPreferenceDelegate() {
 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/HistoricalTabSaver.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/HistoricalTabSaver.java
 --- a/chrome/android/java/src/org/chromium/chrome/browser/tab/HistoricalTabSaver.java
 +++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/HistoricalTabSaver.java
@@ -389,7 +385,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/HistoricalT
 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPersistentStore.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPersistentStore.java
 --- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPersistentStore.java
 +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPersistentStore.java
-@@ -153,7 +153,10 @@ public class TabPersistentStore {
+@@ -152,7 +152,10 @@ public class TabPersistentStore {
              @Override
              public void didCloseTab(Tab tab) {
                  PersistedTabData.onTabClose(tab);
@@ -1265,7 +1261,7 @@ diff --git a/chrome/browser/history/history_tab_helper.cc b/chrome/browser/histo
 --- a/chrome/browser/history/history_tab_helper.cc
 +++ b/chrome/browser/history/history_tab_helper.cc
 @@ -27,6 +27,9 @@
- #include "chrome/browser/android/feed/v2/feed_service_factory.h"
+ #include "chrome/browser/feed/android/feed_service_factory.h"
  #include "components/feed/core/v2/public/feed_api.h"
  #include "components/feed/core/v2/public/feed_service.h"
 +#include "chrome/common/pref_names.h"
@@ -1274,7 +1270,7 @@ diff --git a/chrome/browser/history/history_tab_helper.cc b/chrome/browser/histo
  #else
  #include "chrome/browser/ui/browser.h"
  #include "chrome/browser/ui/browser_finder.h"
-@@ -345,6 +348,13 @@ void HistoryTabHelper::TitleWasSet(NavigationEntry* entry) {
+@@ -358,6 +361,13 @@ void HistoryTabHelper::TitleWasSet(NavigationEntry* entry) {
  history::HistoryService* HistoryTabHelper::GetHistoryService() {
    Profile* profile =
        Profile::FromBrowserContext(web_contents()->GetBrowserContext());
@@ -1288,7 +1284,7 @@ diff --git a/chrome/browser/history/history_tab_helper.cc b/chrome/browser/histo
    if (profile->IsOffTheRecord())
      return NULL;
  
-@@ -352,6 +362,12 @@ history::HistoryService* HistoryTabHelper::GetHistoryService() {
+@@ -365,6 +375,12 @@ history::HistoryService* HistoryTabHelper::GetHistoryService() {
        profile, ServiceAccessType::IMPLICIT_ACCESS);
  }
  
@@ -1304,7 +1300,7 @@ diff --git a/chrome/browser/history/history_tab_helper.cc b/chrome/browser/histo
 diff --git a/chrome/browser/history/history_tab_helper.h b/chrome/browser/history/history_tab_helper.h
 --- a/chrome/browser/history/history_tab_helper.h
 +++ b/chrome/browser/history/history_tab_helper.h
-@@ -10,6 +10,8 @@
+@@ -9,6 +9,8 @@
  #include "build/build_config.h"
  #include "content/public/browser/web_contents_observer.h"
  #include "content/public/browser/web_contents_user_data.h"
@@ -1313,8 +1309,8 @@ diff --git a/chrome/browser/history/history_tab_helper.h b/chrome/browser/histor
  
  namespace history {
  struct HistoryAddPageArgs;
-@@ -39,6 +41,11 @@ class HistoryTabHelper : public content::WebContentsObserver,
-     force_eligibile_tab_for_testing_ = force;
+@@ -41,6 +43,11 @@ class HistoryTabHelper : public content::WebContentsObserver,
+     force_eligible_tab_for_testing_ = force;
    }
  
 +  static void RegisterProfilePrefs(PrefRegistrySimple* registry);
@@ -1325,7 +1321,7 @@ diff --git a/chrome/browser/history/history_tab_helper.h b/chrome/browser/histor
   private:
    explicit HistoryTabHelper(content::WebContents* web_contents);
    friend class content::WebContentsUserData<HistoryTabHelper>;
-@@ -65,9 +72,6 @@ class HistoryTabHelper : public content::WebContentsObserver,
+@@ -69,9 +76,6 @@ class HistoryTabHelper : public content::WebContentsObserver,
                             bool started_from_context_menu,
                             bool renderer_initiated) override;
  
@@ -1338,7 +1334,7 @@ diff --git a/chrome/browser/history/history_tab_helper.h b/chrome/browser/histor
 diff --git a/chrome/browser/history/history_tab_helper_unittest.cc b/chrome/browser/history/history_tab_helper_unittest.cc
 --- a/chrome/browser/history/history_tab_helper_unittest.cc
 +++ b/chrome/browser/history/history_tab_helper_unittest.cc
-@@ -39,6 +39,9 @@
+@@ -40,6 +40,9 @@
  
  using testing::NiceMock;
  
@@ -1348,7 +1344,7 @@ diff --git a/chrome/browser/history/history_tab_helper_unittest.cc b/chrome/brow
  namespace {
  
  #if defined(OS_ANDROID)
-@@ -48,6 +51,25 @@ class TestFeedApi : public feed::StubFeedApi {
+@@ -49,6 +52,25 @@ class TestFeedApi : public feed::StubFeedApi {
  };
  #endif
  
@@ -1484,7 +1480,7 @@ diff --git a/chrome/browser/offline_pages/android/offline_page_model_factory.cc
 diff --git a/chrome/browser/offline_pages/android/request_coordinator_factory.cc b/chrome/browser/offline_pages/android/request_coordinator_factory.cc
 --- a/chrome/browser/offline_pages/android/request_coordinator_factory.cc
 +++ b/chrome/browser/offline_pages/android/request_coordinator_factory.cc
-@@ -29,6 +29,11 @@
+@@ -30,6 +30,11 @@
  #include "components/offline_pages/core/offline_page_feature.h"
  #include "content/public/browser/web_contents.h"
  
@@ -1496,7 +1492,7 @@ diff --git a/chrome/browser/offline_pages/android/request_coordinator_factory.cc
  namespace network {
  class NetworkQualityTracker;
  }
-@@ -114,4 +119,16 @@ KeyedService* RequestCoordinatorFactory::BuildServiceInstanceFor(
+@@ -115,4 +120,16 @@ KeyedService* RequestCoordinatorFactory::BuildServiceInstanceFor(
    return request_coordinator;
  }
  
@@ -1516,19 +1512,18 @@ diff --git a/chrome/browser/offline_pages/android/request_coordinator_factory.cc
 diff --git a/chrome/browser/offline_pages/offline_page_model_factory.h b/chrome/browser/offline_pages/offline_page_model_factory.h
 --- a/chrome/browser/offline_pages/offline_page_model_factory.h
 +++ b/chrome/browser/offline_pages/offline_page_model_factory.h
-@@ -47,6 +47,8 @@ class OfflinePageModelFactory : public SimpleKeyedServiceFactory {
+@@ -48,6 +48,7 @@ class OfflinePageModelFactory : public SimpleKeyedServiceFactory {
+ 
    std::unique_ptr<KeyedService> BuildServiceInstanceFor(
        SimpleFactoryKey* key) const override;
- 
 +  SimpleFactoryKey* GetKeyToUse(SimpleFactoryKey* key) const override;
-+
-   DISALLOW_COPY_AND_ASSIGN(OfflinePageModelFactory);
  };
  
+ }  // namespace offline_pages
 diff --git a/chrome/browser/offline_pages/recent_tab_helper.cc b/chrome/browser/offline_pages/recent_tab_helper.cc
 --- a/chrome/browser/offline_pages/recent_tab_helper.cc
 +++ b/chrome/browser/offline_pages/recent_tab_helper.cc
-@@ -30,6 +30,11 @@
+@@ -29,6 +29,11 @@
  #include "content/public/browser/navigation_entry.h"
  #include "content/public/browser/navigation_handle.h"
  
@@ -1557,20 +1552,19 @@ diff --git a/chrome/browser/offline_pages/recent_tab_helper.cc b/chrome/browser/
 diff --git a/chrome/browser/offline_pages/request_coordinator_factory.h b/chrome/browser/offline_pages/request_coordinator_factory.h
 --- a/chrome/browser/offline_pages/request_coordinator_factory.h
 +++ b/chrome/browser/offline_pages/request_coordinator_factory.h
-@@ -34,6 +34,9 @@ class RequestCoordinatorFactory : public BrowserContextKeyedServiceFactory {
+@@ -36,6 +36,8 @@ class RequestCoordinatorFactory : public BrowserContextKeyedServiceFactory {
+ 
    KeyedService* BuildServiceInstanceFor(
        content::BrowserContext* context) const override;
- 
 +  content::BrowserContext* GetBrowserContextToUse(
 +      content::BrowserContext* context) const override;
-+
-   DISALLOW_COPY_AND_ASSIGN(RequestCoordinatorFactory);
  };
  
+ }  // namespace offline_pages
 diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
 --- a/chrome/browser/prefs/browser_prefs.cc
 +++ b/chrome/browser/prefs/browser_prefs.cc
-@@ -212,6 +212,8 @@
+@@ -214,6 +214,8 @@
  #endif
  
  #if defined(OS_ANDROID)
@@ -1579,18 +1573,18 @@ diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browse
  #include "chrome/browser/android/bookmarks/partner_bookmarks_shim.h"
  #include "chrome/browser/android/explore_sites/history_statistics_reporter.h"
  #include "chrome/browser/android/ntp/recent_tabs_page_prefs.h"
-@@ -1239,6 +1241,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
+@@ -1265,6 +1267,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
    variations::VariationsService::RegisterProfilePrefs(registry);
    video_tutorials::RegisterPrefs(registry);
    feed::prefs::RegisterFeedSharedProfilePrefs(registry);
 +  HistoryTabHelper::RegisterProfilePrefs(registry);
    feed::RegisterProfilePrefs(registry);
- #else  // defined(OS_ANDROID)
+ #else   // defined(OS_ANDROID)
    AppShortcutManager::RegisterProfilePrefs(registry);
 diff --git a/chrome/browser/ui/android/native_page/BUILD.gn b/chrome/browser/ui/android/native_page/BUILD.gn
 --- a/chrome/browser/ui/android/native_page/BUILD.gn
 +++ b/chrome/browser/ui/android/native_page/BUILD.gn
-@@ -31,8 +31,10 @@ java_library("junit") {
+@@ -32,8 +32,10 @@ java_library("junit") {
  
    deps = [
      ":java",
@@ -1613,7 +1607,7 @@ diff --git a/chrome/browser/ui/android/native_page/java/src/org/chromium/chrome/
  /**
   * An interface for pages that will be using Android views instead of html/rendered Web content.
   */
-@@ -156,7 +158,9 @@ public interface NativePage {
+@@ -158,7 +160,9 @@ public interface NativePage {
              return NativePageType.DOWNLOADS;
          } else if (UrlConstants.HISTORY_HOST.equals(host)) {
              return NativePageType.HISTORY;
@@ -1668,7 +1662,7 @@ diff --git a/chrome/browser/ui/android/native_page/java/src/org/chromium/chrome/
 diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
 --- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
 +++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
-@@ -953,6 +953,12 @@ Your Google account may have other forms of browsing history like searches and a
+@@ -1012,6 +1012,12 @@ Your Google account may have other forms of browsing history like searches and a
        <message name="IDS_UI_RELAUNCH_NOTICE" desc="Summary for always incognito mode">
          Your changes will take effect the next time you relaunch Bromite.
        </message>
@@ -1684,7 +1678,7 @@ diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chro
 diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc
 --- a/chrome/common/pref_names.cc
 +++ b/chrome/common/pref_names.cc
-@@ -3238,6 +3238,11 @@ const char kShowCaretBrowsingDialog[] =
+@@ -3287,6 +3287,11 @@ const char kShowCaretBrowsingDialog[] =
  const char kLacrosLaunchSwitch[] = "lacros_launch_switch";
  #endif
  
@@ -1699,9 +1693,9 @@ diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc
 diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h
 --- a/chrome/common/pref_names.h
 +++ b/chrome/common/pref_names.h
-@@ -1192,6 +1192,10 @@ extern const char kLastWhatsNewVersion[];
- extern const char kLensRegionSearchEnabled[];
- #endif
+@@ -1204,6 +1204,10 @@ extern const char kPrivacyGuideViewed[];
+ 
+ extern const char kCorsNonWildcardRequestHeadersSupport[];
  
 +#if defined(OS_ANDROID)
 +extern const char kIncognitoTabHistoryEnabled[];
@@ -1713,7 +1707,7 @@ diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h
 diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
 --- a/chrome/test/BUILD.gn
 +++ b/chrome/test/BUILD.gn
-@@ -4837,6 +4837,11 @@ test("unit_tests") {
+@@ -4880,6 +4880,11 @@ test("unit_tests") {
      ]
    }
  
@@ -1725,6 +1719,5 @@ diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
    if (is_android) {
      sources += [
        "../browser/android/bookmarks/partner_bookmarks_shim_unittest.cc",
--- 
-2.20.1
-
+--
+2.25.1

+ 61 - 90
build/patches/Add-menu-item-to-bookmark-all-tabs.patch

@@ -3,28 +3,28 @@ Date: Thu, 18 Feb 2021 21:22:52 +0100
 Subject: Add menu item to bookmark all tabs
 
 ---
- chrome/android/java/res/menu/main_menu.xml    |  7 ++
- .../chrome/browser/ChromeTabbedActivity.java  | 26 +++++++
- .../browser/bookmarks/BookmarkBridge.java     | 71 +++++++++++++++++--
+ chrome/android/java/res/menu/main_menu.xml    |  7 +++
+ .../chrome/browser/ChromeTabbedActivity.java  | 26 ++++++++
+ .../browser/bookmarks/BookmarkBridge.java     | 60 +++++++++++++++++++
  .../browser/bookmarks/BookmarkUtils.java      |  4 ++
- .../android/bookmarks/bookmark_bridge.cc      | 17 +++++
+ .../android/bookmarks/bookmark_bridge.cc      | 17 ++++++
  .../android/bookmarks/bookmark_bridge.h       |  4 ++
  .../browser/bookmarks/bookmark_html_writer.cc |  8 ++-
  .../bookmarks/chrome_bookmark_client.cc       |  2 +
  .../dialogs/DownloadLocationCustomView.java   |  4 +-
  .../strings/android_chrome_strings.grd        |  3 +
  components/bookmark_bar_strings.grdp          |  6 ++
- .../bookmarks/browser/bookmark_codec.cc       | 24 +++++--
- components/bookmarks/browser/bookmark_codec.h |  7 +-
+ .../bookmarks/browser/bookmark_codec.cc       | 24 ++++++--
+ components/bookmarks/browser/bookmark_codec.h |  7 ++-
  .../browser/bookmark_load_details.cc          |  4 ++
  .../bookmarks/browser/bookmark_load_details.h |  2 +
  .../bookmarks/browser/bookmark_model.cc       |  3 +-
- components/bookmarks/browser/bookmark_model.h |  7 ++
- components/bookmarks/browser/bookmark_node.cc | 15 ++++
+ components/bookmarks/browser/bookmark_model.h |  7 +++
+ components/bookmarks/browser/bookmark_node.cc | 15 +++++
  components/bookmarks/browser/bookmark_node.h  |  5 ++
  components/bookmarks/browser/model_loader.cc  |  3 +-
  .../bookmark_specifics_conversions.cc         |  1 +
- 21 files changed, 208 insertions(+), 15 deletions(-)
+ 21 files changed, 202 insertions(+), 10 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
@@ -40,7 +40,7 @@ diff --git a/chrome/android/java/res/menu/main_menu.xml b/chrome/android/java/re
          <item android:id="@+id/recent_tabs_menu_id"
              android:title="@string/menu_recent_tabs"
              android:icon="@drawable/devices_black_24dp" />
-@@ -147,6 +151,9 @@
+@@ -176,6 +180,9 @@
          <item android:id="@+id/menu_group_tabs"
              android:title="@string/menu_group_tabs"
              android:icon="@drawable/ic_widgets" />
@@ -62,7 +62,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedAct
  import org.chromium.chrome.browser.bookmarks.BookmarkUtils;
  import org.chromium.chrome.browser.browserservices.intents.WebappConstants;
  import org.chromium.chrome.browser.compositor.CompositorViewHolder;
-@@ -2040,6 +2042,8 @@ public class ChromeTabbedActivity extends ChromeActivity<ChromeActivityComponent
+@@ -2054,6 +2056,8 @@ public class ChromeTabbedActivity extends ChromeActivity<ChromeActivityComponent
              // Close both incognito and normal tabs
              getTabModelSelector().closeAllTabs();
              RecordUserAction.record("MobileMenuCloseAllTabs");
@@ -71,7 +71,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedAct
          } else if (id == R.id.close_all_incognito_tabs_menu_id) {
              // Close only incognito tabs
              getTabModelSelector().getModel(true).closeAllTabs();
-@@ -2089,6 +2093,28 @@ public class ChromeTabbedActivity extends ChromeActivity<ChromeActivityComponent
+@@ -2103,6 +2107,28 @@ public class ChromeTabbedActivity extends ChromeActivity<ChromeActivityComponent
          mTabModalHandler.onOmniboxFocusChanged(hasFocus);
      }
  
@@ -103,25 +103,17 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedAct
 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkBridge.java
 --- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkBridge.java
 +++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkBridge.java
-@@ -4,6 +4,7 @@
- 
- package org.chromium.chrome.browser.bookmarks;
- 
-+import android.app.Activity;
- import android.content.Intent;
- import android.content.Context;
- import android.content.pm.PackageManager;
-@@ -24,6 +25,7 @@ import androidx.annotation.Nullable;
- import androidx.annotation.VisibleForTesting;
+@@ -28,6 +28,7 @@ import com.google.common.primitives.UnsignedLongs;
+ import com.google.protobuf.InvalidProtocolBufferException;
  
  import org.chromium.base.ContextUtils;
 +import org.chromium.base.Log;
  import org.chromium.base.ObserverList;
  import org.chromium.base.ThreadUtils;
  import org.chromium.base.annotations.CalledByNative;
-@@ -32,6 +34,10 @@ import org.chromium.base.metrics.RecordHistogram;
- import org.chromium.chrome.browser.partnerbookmarks.PartnerBookmarksShim;
- import org.chromium.chrome.browser.profiles.Profile;
+@@ -45,6 +46,10 @@ import org.chromium.chrome.browser.subscriptions.CommerceSubscription;
+ import org.chromium.chrome.browser.subscriptions.CommerceSubscriptionsServiceFactory;
+ import org.chromium.chrome.browser.subscriptions.SubscriptionsManager;
  import org.chromium.chrome.browser.tab.Tab;
 +import org.chromium.chrome.browser.ui.messages.snackbar.Snackbar;
 +import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager;
@@ -129,16 +121,16 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm
 +import org.chromium.chrome.R;
  import org.chromium.components.bookmarks.BookmarkId;
  import org.chromium.components.bookmarks.BookmarkType;
- import org.chromium.components.url_formatter.SchemeDisplay;
-@@ -72,6 +78,7 @@ import java.io.File;
+ import org.chromium.components.commerce.PriceTracking.ProductPrice;
+@@ -90,6 +95,7 @@ import java.io.File;
   * bookmark model stored in native.
   */
  public class BookmarkBridge {
 +    private static final String TAG = "BookmarkBridge";
      private final Profile mProfile;
+     private boolean mIsDestroyed;
      private boolean mIsDoingExtensiveChanges;
-     private long mNativeBookmarkBridge;
-@@ -553,6 +560,16 @@ public class BookmarkBridge {
+@@ -630,6 +636,16 @@ public class BookmarkBridge {
                  mNativeBookmarkBridge, BookmarkBridge.this);
      }
  
@@ -155,36 +147,16 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm
      /**
       * @return Id representing the special "other" folder from bookmark model.
       */
-@@ -770,14 +787,14 @@ public class BookmarkBridge {
-                 if (mDialogModel != null) return;
- 
-                 // Actually show the dialog.
--                mCustomView = (DownloadLocationCustomView) LayoutInflater.from(mContext).inflate(
-+                mCustomView = (DownloadLocationCustomView) LayoutInflater.from(context).inflate(
-                         R.layout.download_location_dialog, null);
--                mCustomView.initialize(
--                        DownloadLocationDialogType.DEFAULT, new File(standardBoorkmarkName), 
--                        /*totalBytes*/ 0, context.getString(R.string.export_bookmarks_alert_title));
-+                mCustomView.initialize(DownloadLocationDialogType.DEFAULT, /*totalBytes*/ 0);
-+                mCustomView.setTitle(context.getString(R.string.export_bookmarks_alert_title));
-+                mCustomView.setFileName(standardBoorkmarkName);
-                 mCustomView.mDontShowAgain.setVisibility(View.GONE);
- 
--                Resources resources = mContext.getResources();
-+                Resources resources = context.getResources();
-                 mDialogModel = new PropertyModel.Builder(ModalDialogProperties.ALL_KEYS)
-                                     .with(ModalDialogProperties.CONTROLLER, this)
-                                     .with(ModalDialogProperties.CUSTOM_VIEW, mCustomView)
-@@ -1099,6 +1116,49 @@ public class BookmarkBridge {
+@@ -1341,6 +1357,49 @@ public class BookmarkBridge {
                  mNativeBookmarkBridge, BookmarkBridge.this, title, url);
      }
  
 +    // Used to bookmark all tabs in a specific folder, created if not existing
 +    public BookmarkId addToTabsCollection(Context context, Tab tab) {
 +        BookmarkId parent = getTabsCollectionFolderId();
-+        long existingId = getUserBookmarkIdForTab(tab);
-+        if (existingId != BookmarkId.INVALID_ID) {
-+            BookmarkId existingBookmarkId = new BookmarkId(existingId, BookmarkType.NORMAL);
++        BookmarkId existingId = getUserBookmarkIdForTab(tab);
++        if (existingId != null && existingId.getId() != BookmarkId.INVALID_ID) {
++            BookmarkId existingBookmarkId = new BookmarkId(existingId.getId(), BookmarkType.NORMAL);
 +            BookmarkItem existingBookmark = getBookmarkById(existingBookmarkId);
 +            if (parent.equals(existingBookmark.getParentId())) {
 +                // bookmark already exists in the tabs collection folder
@@ -225,7 +197,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm
      /**
       * @param url The URL of the reading list item.
       * @return The reading list item with the URL, or null if no such reading list item.
-@@ -1355,6 +1415,7 @@ public class BookmarkBridge {
+@@ -1638,6 +1697,7 @@ public class BookmarkBridge {
          void getAllFoldersWithDepths(long nativeBookmarkBridge, BookmarkBridge caller,
                  List<BookmarkId> folderList, List<Integer> depthList);
          BookmarkId getRootFolderId(long nativeBookmarkBridge, BookmarkBridge caller);
@@ -236,7 +208,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
-@@ -515,6 +515,7 @@ public class BookmarkUtils {
+@@ -628,6 +628,7 @@ public class BookmarkUtils {
          List<BookmarkId> topLevelFolders = new ArrayList<>();
          BookmarkId desktopNodeId = bookmarkModel.getDesktopFolderId();
          BookmarkId mobileNodeId = bookmarkModel.getMobileFolderId();
@@ -244,7 +216,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm
          BookmarkId othersNodeId = bookmarkModel.getOtherFolderId();
  
          List<BookmarkId> specialFoldersIds =
-@@ -540,6 +541,9 @@ public class BookmarkUtils {
+@@ -653,6 +654,9 @@ public class BookmarkUtils {
          if (bookmarkModel.isFolderVisible(mobileNodeId)) {
              topLevelFolders.add(mobileNodeId);
          }
@@ -257,7 +229,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/Bookm
 diff --git a/chrome/browser/android/bookmarks/bookmark_bridge.cc b/chrome/browser/android/bookmarks/bookmark_bridge.cc
 --- a/chrome/browser/android/bookmarks/bookmark_bridge.cc
 +++ b/chrome/browser/android/bookmarks/bookmark_bridge.cc
-@@ -424,6 +424,11 @@ void BookmarkBridge::GetTopLevelFolderIDs(
+@@ -435,6 +435,11 @@ void BookmarkBridge::GetTopLevelFolderIDs(
          top_level_folders.push_back(node.get());
      }
  
@@ -269,7 +241,7 @@ diff --git a/chrome/browser/android/bookmarks/bookmark_bridge.cc b/chrome/browse
      for (const auto& node : bookmark_model_->bookmark_bar_node()->children()) {
        if (node->is_folder())
          top_level_folders.push_back(node.get());
-@@ -462,6 +467,7 @@ void BookmarkBridge::GetAllFoldersWithDepths(
+@@ -483,6 +488,7 @@ void BookmarkBridge::GetAllFoldersWithDepths(
    // Vector to temporarily contain all child bookmarks at same level for sorting
    std::vector<const BookmarkNode*> bookmarks = {
        bookmark_model_->mobile_node(),
@@ -277,7 +249,7 @@ diff --git a/chrome/browser/android/bookmarks/bookmark_bridge.cc b/chrome/browse
        bookmark_model_->bookmark_bar_node(),
        bookmark_model_->other_node(),
    };
-@@ -516,6 +522,17 @@ ScopedJavaLocalRef<jobject> BookmarkBridge::GetMobileFolderId(
+@@ -537,6 +543,17 @@ ScopedJavaLocalRef<jobject> BookmarkBridge::GetMobileFolderId(
    return folder_id_obj;
  }
  
@@ -298,7 +270,7 @@ diff --git a/chrome/browser/android/bookmarks/bookmark_bridge.cc b/chrome/browse
 diff --git a/chrome/browser/android/bookmarks/bookmark_bridge.h b/chrome/browser/android/bookmarks/bookmark_bridge.h
 --- a/chrome/browser/android/bookmarks/bookmark_bridge.h
 +++ b/chrome/browser/android/bookmarks/bookmark_bridge.h
-@@ -110,6 +110,10 @@ class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver,
+@@ -121,6 +121,10 @@ class BookmarkBridge : public bookmarks::BaseBookmarkModelObserver,
        JNIEnv* env,
        const base::android::JavaParamRef<jobject>& obj);
  
@@ -312,7 +284,7 @@ diff --git a/chrome/browser/android/bookmarks/bookmark_bridge.h b/chrome/browser
 diff --git a/chrome/browser/bookmarks/bookmark_html_writer.cc b/chrome/browser/bookmarks/bookmark_html_writer.cc
 --- a/chrome/browser/bookmarks/bookmark_html_writer.cc
 +++ b/chrome/browser/bookmarks/bookmark_html_writer.cc
-@@ -186,6 +186,8 @@ class Writer : public base::RefCountedThreadSafe<Writer> {
+@@ -191,6 +191,8 @@ class Writer : public base::RefCountedThreadSafe<Writer> {
          roots->FindDictKey(BookmarkCodec::kOtherBookmarkFolderNameKey);
      base::Value* mobile_folder_value =
          roots->FindDictKey(BookmarkCodec::kMobileBookmarkFolderNameKey);
@@ -321,7 +293,7 @@ diff --git a/chrome/browser/bookmarks/bookmark_html_writer.cc b/chrome/browser/b
      DCHECK(root_folder_value);
      DCHECK(other_folder_value);
      DCHECK(mobile_folder_value);
-@@ -197,7 +199,9 @@ class Writer : public base::RefCountedThreadSafe<Writer> {
+@@ -202,7 +204,9 @@ class Writer : public base::RefCountedThreadSafe<Writer> {
          !WriteNode(*static_cast<base::DictionaryValue*>(other_folder_value),
                     BookmarkNode::OTHER_NODE) ||
          !WriteNode(*static_cast<base::DictionaryValue*>(mobile_folder_value),
@@ -332,7 +304,7 @@ diff --git a/chrome/browser/bookmarks/bookmark_html_writer.cc b/chrome/browser/b
        NotifyOnFinish(BookmarksExportObserver::Result::kCouldNotWriteNodes);
        return;
      }
-@@ -464,6 +468,8 @@ void BookmarkFaviconFetcher::ExportBookmarks() {
+@@ -467,6 +471,8 @@ void BookmarkFaviconFetcher::ExportBookmarks() {
        BookmarkModelFactory::GetForBrowserContext(profile_)->other_node());
    ExtractUrls(
        BookmarkModelFactory::GetForBrowserContext(profile_)->mobile_node());
@@ -344,7 +316,7 @@ diff --git a/chrome/browser/bookmarks/bookmark_html_writer.cc b/chrome/browser/b
 diff --git a/chrome/browser/bookmarks/chrome_bookmark_client.cc b/chrome/browser/bookmarks/chrome_bookmark_client.cc
 --- a/chrome/browser/bookmarks/chrome_bookmark_client.cc
 +++ b/chrome/browser/bookmarks/chrome_bookmark_client.cc
-@@ -105,6 +105,8 @@ bool ChromeBookmarkClient::IsPermanentNodeVisibleWhenEmpty(
+@@ -117,6 +117,8 @@ bool ChromeBookmarkClient::IsPermanentNodeVisibleWhenEmpty(
        return !is_mobile;
      case bookmarks::BookmarkNode::MOBILE:
        return is_mobile;
@@ -356,7 +328,7 @@ diff --git a/chrome/browser/bookmarks/chrome_bookmark_client.cc b/chrome/browser
 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
-@@ -75,7 +75,7 @@ public class DownloadLocationCustomView
+@@ -79,7 +79,7 @@ public class DownloadLocationCustomView
          mDirectoryAdapter.update();
      }
  
@@ -365,7 +337,7 @@ diff --git a/chrome/browser/download/android/java/src/org/chromium/chrome/browse
          mTitle.setText(title);
      }
  
-@@ -83,7 +83,7 @@ public class DownloadLocationCustomView
+@@ -87,7 +87,7 @@ public class DownloadLocationCustomView
          mSubtitleView.setText(subtitle);
      }
  
@@ -377,7 +349,7 @@ diff --git a/chrome/browser/download/android/java/src/org/chromium/chrome/browse
 diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
 --- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
 +++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
-@@ -3273,6 +3273,9 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
+@@ -3421,6 +3421,9 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
        <message name="IDS_MENU_TRACK_PRICES" desc="Menu item for tracking prices on tabs. [CHAR_LIMIT=27]">
          Track prices
        </message>
@@ -519,7 +491,7 @@ diff --git a/components/bookmarks/browser/bookmark_codec.cc b/components/bookmar
 diff --git a/components/bookmarks/browser/bookmark_codec.h b/components/bookmarks/browser/bookmark_codec.h
 --- a/components/bookmarks/browser/bookmark_codec.h
 +++ b/components/bookmarks/browser/bookmark_codec.h
-@@ -46,6 +46,7 @@ class BookmarkCodec {
+@@ -49,6 +49,7 @@ class BookmarkCodec {
    base::Value Encode(const BookmarkNode* bookmark_bar_node,
                       const BookmarkNode* other_folder_node,
                       const BookmarkNode* mobile_folder_node,
@@ -527,7 +499,7 @@ diff --git a/components/bookmarks/browser/bookmark_codec.h b/components/bookmark
                       const BookmarkNode::MetaInfoMap* model_meta_info_map,
                       const std::string& sync_metadata_str);
  
-@@ -58,6 +59,7 @@ class BookmarkCodec {
+@@ -61,6 +62,7 @@ class BookmarkCodec {
                BookmarkNode* bb_node,
                BookmarkNode* other_folder_node,
                BookmarkNode* mobile_folder_node,
@@ -535,7 +507,7 @@ diff --git a/components/bookmarks/browser/bookmark_codec.h b/components/bookmark
                int64_t* max_node_id,
                std::string* sync_metadata_str);
  
-@@ -103,6 +105,7 @@ class BookmarkCodec {
+@@ -106,6 +108,7 @@ class BookmarkCodec {
    // Allows the BookmarkClient to read and a write a string blob from the JSON
    // file. That string captures the bookmarks sync metadata.
    static const char kSyncMetadata[];
@@ -543,7 +515,7 @@ diff --git a/components/bookmarks/browser/bookmark_codec.h b/components/bookmark
  
    // Possible values for kTypeKey.
    static const char kTypeURL[];
-@@ -119,6 +122,7 @@ class BookmarkCodec {
+@@ -122,6 +125,7 @@ class BookmarkCodec {
    bool DecodeHelper(BookmarkNode* bb_node,
                      BookmarkNode* other_folder_node,
                      BookmarkNode* mobile_folder_node,
@@ -551,7 +523,7 @@ diff --git a/components/bookmarks/browser/bookmark_codec.h b/components/bookmark
                      const base::Value& value,
                      std::string* sync_metadata_str);
  
-@@ -130,7 +134,8 @@ class BookmarkCodec {
+@@ -133,7 +137,8 @@ class BookmarkCodec {
    // Reassigns bookmark IDs for all nodes.
    void ReassignIDs(BookmarkNode* bb_node,
                     BookmarkNode* other_node,
@@ -578,7 +550,7 @@ diff --git a/components/bookmarks/browser/bookmark_load_details.cc b/components/
 diff --git a/components/bookmarks/browser/bookmark_load_details.h b/components/bookmarks/browser/bookmark_load_details.h
 --- a/components/bookmarks/browser/bookmark_load_details.h
 +++ b/components/bookmarks/browser/bookmark_load_details.h
-@@ -42,6 +42,7 @@ class BookmarkLoadDetails {
+@@ -43,6 +43,7 @@ class BookmarkLoadDetails {
    BookmarkPermanentNode* bb_node() { return bb_node_; }
    BookmarkPermanentNode* mobile_folder_node() { return mobile_folder_node_; }
    BookmarkPermanentNode* other_folder_node() { return other_folder_node_; }
@@ -586,10 +558,10 @@ diff --git a/components/bookmarks/browser/bookmark_load_details.h b/components/b
  
    TitledUrlIndex* index() { return index_.get(); }
    std::unique_ptr<TitledUrlIndex> owned_index() { return std::move(index_); }
-@@ -96,6 +97,7 @@ class BookmarkLoadDetails {
-   BookmarkPermanentNode* bb_node_ = nullptr;
-   BookmarkPermanentNode* other_folder_node_ = nullptr;
-   BookmarkPermanentNode* mobile_folder_node_ = nullptr;
+@@ -97,6 +98,7 @@ class BookmarkLoadDetails {
+   raw_ptr<BookmarkPermanentNode> bb_node_ = nullptr;
+   raw_ptr<BookmarkPermanentNode> other_folder_node_ = nullptr;
+   raw_ptr<BookmarkPermanentNode> mobile_folder_node_ = nullptr;
 +  BookmarkPermanentNode* tabs_collection_folder_node_ = nullptr;
    LoadManagedNodeCallback load_managed_node_callback_;
    std::unique_ptr<TitledUrlIndex> index_;
@@ -597,7 +569,7 @@ diff --git a/components/bookmarks/browser/bookmark_load_details.h b/components/b
 diff --git a/components/bookmarks/browser/bookmark_model.cc b/components/bookmarks/browser/bookmark_model.cc
 --- a/components/bookmarks/browser/bookmark_model.cc
 +++ b/components/bookmarks/browser/bookmark_model.cc
-@@ -562,7 +562,7 @@ bool BookmarkModel::HasBookmarks() {
+@@ -564,7 +564,7 @@ bool BookmarkModel::HasBookmarks() {
  bool BookmarkModel::HasNoUserCreatedBookmarksOrFolders() {
    DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
    return bookmark_bar_node_->children().empty() &&
@@ -606,7 +578,7 @@ diff --git a/components/bookmarks/browser/bookmark_model.cc b/components/bookmar
  }
  
  bool BookmarkModel::IsBookmarked(const GURL& url) {
-@@ -804,6 +804,7 @@ void BookmarkModel::DoneLoading(std::unique_ptr<BookmarkLoadDetails> details) {
+@@ -806,6 +806,7 @@ void BookmarkModel::DoneLoading(std::unique_ptr<BookmarkLoadDetails> details) {
    bookmark_bar_node_ = details->bb_node();
    other_node_ = details->other_folder_node();
    mobile_node_ = details->mobile_folder_node();
@@ -617,7 +589,7 @@ diff --git a/components/bookmarks/browser/bookmark_model.cc b/components/bookmar
 diff --git a/components/bookmarks/browser/bookmark_model.h b/components/bookmarks/browser/bookmark_model.h
 --- a/components/bookmarks/browser/bookmark_model.h
 +++ b/components/bookmarks/browser/bookmark_model.h
-@@ -116,6 +116,12 @@ class BookmarkModel : public BookmarkUndoProvider,
+@@ -120,6 +120,12 @@ class BookmarkModel : public BookmarkUndoProvider,
      return mobile_node_;
    }
  
@@ -630,10 +602,10 @@ diff --git a/components/bookmarks/browser/bookmark_model.h b/components/bookmark
    bool is_root_node(const BookmarkNode* node) const {
      DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
      return node == root_;
-@@ -391,6 +397,7 @@ class BookmarkModel : public BookmarkUndoProvider,
-   BookmarkPermanentNode* bookmark_bar_node_ = nullptr;
-   BookmarkPermanentNode* other_node_ = nullptr;
-   BookmarkPermanentNode* mobile_node_ = nullptr;
+@@ -395,6 +401,7 @@ class BookmarkModel : public BookmarkUndoProvider,
+   raw_ptr<BookmarkPermanentNode> bookmark_bar_node_ = nullptr;
+   raw_ptr<BookmarkPermanentNode> other_node_ = nullptr;
+   raw_ptr<BookmarkPermanentNode> mobile_node_ = nullptr;
 +  BookmarkPermanentNode* tabs_collection_node_ = nullptr;
  
    // The maximum ID assigned to the bookmark nodes in the model.
@@ -673,7 +645,7 @@ diff --git a/components/bookmarks/browser/bookmark_node.cc b/components/bookmark
 diff --git a/components/bookmarks/browser/bookmark_node.h b/components/bookmarks/browser/bookmark_node.h
 --- a/components/bookmarks/browser/bookmark_node.h
 +++ b/components/bookmarks/browser/bookmark_node.h
-@@ -36,6 +36,7 @@ class BookmarkNode : public ui::TreeNode<BookmarkNode>, public TitledUrlNode {
+@@ -35,6 +35,7 @@ class BookmarkNode : public ui::TreeNode<BookmarkNode>, public TitledUrlNode {
      FOLDER,
      BOOKMARK_BAR,
      OTHER_NODE,
@@ -681,7 +653,7 @@ diff --git a/components/bookmarks/browser/bookmark_node.h b/components/bookmarks
      MOBILE
    };
  
-@@ -53,6 +54,7 @@ class BookmarkNode : public ui::TreeNode<BookmarkNode>, public TitledUrlNode {
+@@ -52,6 +53,7 @@ class BookmarkNode : public ui::TreeNode<BookmarkNode>, public TitledUrlNode {
    static const char kBookmarkBarNodeGuid[];
    static const char kOtherBookmarksNodeGuid[];
    static const char kMobileBookmarksNodeGuid[];
@@ -689,7 +661,7 @@ diff --git a/components/bookmarks/browser/bookmark_node.h b/components/bookmarks
    static const char kManagedNodeGuid[];
  
    // A bug in sync caused some problematic GUIDs to be produced.
-@@ -247,6 +249,9 @@ class BookmarkPermanentNode : public BookmarkNode {
+@@ -250,6 +252,9 @@ class BookmarkPermanentNode : public BookmarkNode {
    static std::unique_ptr<BookmarkPermanentNode> CreateMobileBookmarks(
        int64_t id,
        bool visible_when_empty);
@@ -723,6 +695,5 @@ diff --git a/components/sync_bookmarks/bookmark_specifics_conversions.cc b/compo
        DCHECK(node->is_folder());
        return sync_pb::BookmarkSpecifics::FOLDER;
    }
--- 
-2.20.1
-
+--
+2.25.1

+ 14 - 15
build/patches/Add-menu-item-to-view-source.patch

@@ -28,7 +28,7 @@ diff --git a/chrome/android/java/res/menu/custom_tabs_menu.xml b/chrome/android/
 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
 +++ b/chrome/android/java/res/menu/main_menu.xml
-@@ -88,6 +88,9 @@
+@@ -106,6 +106,9 @@
          <item android:id="@+id/add_to_homescreen_id"
              android:title="@string/menu_add_to_homescreen"
              android:icon="@drawable/ic_add_to_home_screen" />
@@ -41,7 +41,7 @@ diff --git a/chrome/android/java/res/menu/main_menu.xml b/chrome/android/java/re
 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
 +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
-@@ -2063,6 +2063,8 @@ public class ChromeTabbedActivity extends ChromeActivity<ChromeActivityComponent
+@@ -2077,6 +2077,8 @@ public class ChromeTabbedActivity extends ChromeActivity<ChromeActivityComponent
                  NewTabPageUma.recordAction(NewTabPageUma.ACTION_OPENED_DOWNLOADS_MANAGER);
              }
              RecordUserAction.record("MobileMenuDownloadManager");
@@ -53,7 +53,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedAct
 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
 --- a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
 +++ b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
-@@ -2436,6 +2436,11 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
+@@ -2558,6 +2558,11 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
              return true;
          }
  
@@ -68,16 +68,16 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActiv
 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateImpl.java
 --- a/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateImpl.java
 +++ b/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateImpl.java
-@@ -355,6 +355,7 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate
+@@ -502,6 +502,7 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate
                          isChromeScheme, isFileScheme, isContentScheme, isIncognito, url));
  
-         updateRequestDesktopSiteMenuItem(menu, currentTab, true /* can show */);
+         updateRequestDesktopSiteMenuItem(menu, currentTab, true /* can show */, isChromeScheme);
 +        updateViewSourceMenuItem(menu, currentTab);
  
-         // Only display reader mode settings menu option if the current page is in reader mode.
-         menu.findItem(R.id.reader_mode_prefs_id).setVisible(shouldShowReaderModePrefs(currentTab));
-@@ -845,6 +846,19 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate
-         }
+         updateAutoDarkMenuItem(menu, currentTab, isChromeScheme);
+ 
+@@ -1135,6 +1136,19 @@ public class AppMenuPropertiesDelegateImpl implements AppMenuPropertiesDelegate
+         stopPriceTrackingMenuItem.setVisible(priceTrackingEnabled);
      }
  
 +    /**
@@ -99,10 +99,10 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/App
 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java
 --- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java
 +++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabAppMenuPropertiesDelegate.java
-@@ -214,6 +214,7 @@ public class CustomTabAppMenuPropertiesDelegate extends AppMenuPropertiesDelegat
-             }
+@@ -212,6 +212,7 @@ public class CustomTabAppMenuPropertiesDelegate extends AppMenuPropertiesDelegat
  
-             updateRequestDesktopSiteMenuItem(menu, currentTab, requestDesktopSiteVisible);
+             updateRequestDesktopSiteMenuItem(
+                     menu, currentTab, requestDesktopSiteVisible, isChromeScheme);
 +            updateViewSourceMenuItem(menu, currentTab);
              prepareAddToHomescreenMenuItem(menu, currentTab, addToHomeScreenVisible);
          }
@@ -121,6 +121,5 @@ diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chro
        <message name="IDS_UNSUPPORTED" desc="Message displayed to the user when an attempted action is not supported.">
          Unsupported
        </message>
--- 
-2.20.1
-
+--
+2.25.1

+ 45 - 32
build/patches/Add-option-to-force-tablet-UI.patch

@@ -3,17 +3,17 @@ Date: Mon, 1 Feb 2021 19:18:55 +0200
 Subject: Add option to force tablet UI
 
 ---
- .../android/java/res/xml/accessibility_preferences.xml |  5 +++++
- .../accessibility/settings/AccessibilitySettings.java  | 10 ++++++++++
- .../browser/preferences/ChromePreferenceKeys.java      |  1 +
- .../preferences/LegacyChromePreferenceKeys.java        |  1 +
- .../chrome/browser/omnibox/LocationBarCoordinator.java |  2 +-
- .../ui/android/strings/android_chrome_strings.grd      |  6 ++++++
- .../browser/toolbar/top/ToolbarControlContainer.java   |  2 +-
- components/BUILD.gn                                    |  4 ++--
- ui/android/BUILD.gn                                    |  2 ++
- .../src/org/chromium/ui/base/DeviceFormFactor.java     |  5 +++++
- 10 files changed, 34 insertions(+), 4 deletions(-)
+ .../java/res/xml/accessibility_preferences.xml   |  5 +++++
+ .../settings/AccessibilitySettings.java          | 10 ++++++++++
+ .../preferences/ChromePreferenceKeys.java        |  1 +
+ .../preferences/LegacyChromePreferenceKeys.java  |  1 +
+ .../browser/omnibox/LocationBarCoordinator.java  |  2 +-
+ .../android/strings/android_chrome_strings.grd   |  6 ++++++
+ .../toolbar/top/ToolbarControlContainer.java     | 16 ----------------
+ components/BUILD.gn                              |  4 ++--
+ ui/android/BUILD.gn                              |  2 ++
+ .../org/chromium/ui/base/DeviceFormFactor.java   |  5 +++++
+ 10 files changed, 33 insertions(+), 19 deletions(-)
 
 diff --git a/chrome/android/java/res/xml/accessibility_preferences.xml b/chrome/android/java/res/xml/accessibility_preferences.xml
 --- a/chrome/android/java/res/xml/accessibility_preferences.xml
@@ -33,15 +33,15 @@ diff --git a/chrome/android/java/res/xml/accessibility_preferences.xml b/chrome/
 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/accessibility/settings/AccessibilitySettings.java b/chrome/android/java/src/org/chromium/chrome/browser/accessibility/settings/AccessibilitySettings.java
 --- a/chrome/android/java/src/org/chromium/chrome/browser/accessibility/settings/AccessibilitySettings.java
 +++ b/chrome/android/java/src/org/chromium/chrome/browser/accessibility/settings/AccessibilitySettings.java
-@@ -37,6 +37,7 @@ public class AccessibilitySettings
+@@ -35,6 +35,7 @@ public class AccessibilitySettings
+     static final String PREF_CAPTIONS = "captions";
      static final String PREF_IMAGE_DESCRIPTIONS = "image_descriptions";
-     static final String PREF_ACCESSIBILITY_PAGE_ZOOM = "accessibility_page_zoom";
  
 +    static final String PREF_FORCE_TABLET_UI = "force_tablet_ui";
      private TextScalePreference mTextScalePref;
      private ChromeBaseCheckBoxPreference mForceEnableZoomPref;
      private boolean mRecordFontSizeChangeOnStop;
-@@ -82,6 +83,12 @@ public class AccessibilitySettings
+@@ -80,6 +81,12 @@ public class AccessibilitySettings
                                                        .getBoolean(Pref.READER_FOR_ACCESSIBILITY));
          readerForAccessibilityPref.setOnPreferenceChangeListener(this);
  
@@ -54,7 +54,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/accessibility/s
          ChromeBaseCheckBoxPreference mAccessibilityTabSwitcherPref =
                  (ChromeBaseCheckBoxPreference) findPreference(
                          ChromePreferenceKeys.ACCESSIBILITY_TAB_SWITCHER);
-@@ -137,6 +144,9 @@ public class AccessibilitySettings
+@@ -131,6 +138,9 @@ public class AccessibilitySettings
              mFontSizePrefs.setUserFontScaleFactor((Float) newValue);
          } else if (PREF_FORCE_ENABLE_ZOOM.equals(preference.getKey())) {
              mFontSizePrefs.setForceEnableZoomFromUser((Boolean) newValue);
@@ -67,7 +67,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/accessibility/s
 diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java
 --- a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java
 +++ b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java
-@@ -543,6 +543,7 @@ public final class ChromePreferenceKeys {
+@@ -508,6 +508,7 @@ public final class ChromePreferenceKeys {
      public static final String FONT_USER_SET_FORCE_ENABLE_ZOOM = "user_set_force_enable_zoom";
  
      public static final String HISTORY_SHOW_HISTORY_INFO = "history_home_show_info";
@@ -78,7 +78,7 @@ diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/bro
 diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/LegacyChromePreferenceKeys.java b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/LegacyChromePreferenceKeys.java
 --- a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/LegacyChromePreferenceKeys.java
 +++ b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/LegacyChromePreferenceKeys.java
-@@ -99,6 +99,7 @@ public class LegacyChromePreferenceKeys {
+@@ -98,6 +98,7 @@ public class LegacyChromePreferenceKeys {
                  ChromePreferenceKeys.FLAGS_CACHED_SWAP_PIXEL_FORMAT_TO_FIX_CONVERT_FROM_TRANSLUCENT,
                  ChromePreferenceKeys.FLAGS_CACHED_TAB_GROUPS_ANDROID_ENABLED,
                  ChromePreferenceKeys.FONT_USER_FONT_SCALE_FACTOR,
@@ -89,7 +89,7 @@ diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/bro
 diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarCoordinator.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarCoordinator.java
 --- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarCoordinator.java
 +++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarCoordinator.java
-@@ -348,7 +348,7 @@ public final class LocationBarCoordinator implements LocationBar, NativeInitObse
+@@ -352,7 +352,7 @@ public final class LocationBarCoordinator implements LocationBar, NativeInitObse
      // OmniboxSuggestionsDropdownEmbedder implementation
      @Override
      public boolean isTablet() {
@@ -101,7 +101,7 @@ diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/brow
 diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
 --- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
 +++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
-@@ -1223,6 +1223,12 @@ Your Google account may have other forms of browsing history like searches and a
+@@ -1316,6 +1316,12 @@ Your Google account may have other forms of browsing history like searches and a
        <message name="IDS_SAFE_BROWSING_NO_PROTECTION_CONFIRMATION_DIALOG_CONFIRM" desc="Message for Safe Browsing no protection confirmation button.">
          Turn off
        </message>
@@ -117,19 +117,33 @@ diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chro
 diff --git a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarControlContainer.java b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarControlContainer.java
 --- a/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarControlContainer.java
 +++ b/chrome/browser/ui/android/toolbar/java/src/org/chromium/chrome/browser/toolbar/top/ToolbarControlContainer.java
-@@ -109,7 +109,7 @@ public class ToolbarControlContainer extends OptimizedFrameLayout implements Con
-             // On tablet, draw a fake tab strip and toolbar until the compositor is
-             // ready to draw the real tab strip. (On phone, the toolbar is made entirely
-             // of Android views, which are already initialized.)
--            setBackgroundResource(R.drawable.toolbar_background);
-+//             setBackgroundResource(R.drawable.toolbar_background);
-         }
+@@ -106,22 +106,6 @@ public class ToolbarControlContainer extends OptimizedFrameLayout implements Con
+     public void setToolbar(Toolbar toolbar, boolean isIncognito) {
+         mToolbar = toolbar;
+         mToolbarContainer.setToolbar(mToolbar);
+-
+-        View toolbarView = findViewById(R.id.toolbar);
+-        assert toolbarView != null;
+-
+-        if (toolbarView instanceof ToolbarTablet) {
+-            // On tablet, draw a fake tab strip and toolbar until the compositor is
+-            // ready to draw the real tab strip. (On phone, the toolbar is made entirely
+-            // of Android views, which are already initialized.)
+-            final Drawable backgroundDrawable =
+-                    AppCompatResources.getDrawable(getContext(), R.drawable.toolbar_background)
+-                            .mutate();
+-            backgroundDrawable.setTint(
+-                    ChromeColors.getDefaultThemeColor(getContext(), isIncognito));
+-            backgroundDrawable.setTintMode(PorterDuff.Mode.MULTIPLY);
+-            setBackground(backgroundDrawable);
+-        }
      }
  
+     @Override
 diff --git a/components/BUILD.gn b/components/BUILD.gn
 --- a/components/BUILD.gn
 +++ b/components/BUILD.gn
-@@ -549,7 +549,7 @@ test("components_unittests") {
+@@ -572,7 +572,7 @@ test("components_unittests") {
  
    # On LaCrOS, tests use ash - chrome as a window manager, thus the dependency.
    # On other platforms, no components should depend on Chrome.
@@ -138,7 +152,7 @@ diff --git a/components/BUILD.gn b/components/BUILD.gn
      assert_no_deps = [ "//chrome/*" ]
    }
  
-@@ -798,7 +798,7 @@ if (!is_ios) {
+@@ -836,7 +836,7 @@ if (!is_ios) {
  
      # On LaCrOS, tests use ash - chrome as a window manager, thus the dependency.
      # On other platforms, no components should depend on Chrome.
@@ -150,7 +164,7 @@ diff --git a/components/BUILD.gn b/components/BUILD.gn
 diff --git a/ui/android/BUILD.gn b/ui/android/BUILD.gn
 --- a/ui/android/BUILD.gn
 +++ b/ui/android/BUILD.gn
-@@ -369,6 +369,8 @@ android_library("ui_no_recycler_view_java") {
+@@ -358,6 +358,8 @@ android_library("ui_no_recycler_view_java") {
      ":ui_java_resources",
      ":ui_utils_java",
      "//base:base_java",
@@ -181,6 +195,5 @@ diff --git a/ui/android/java/src/org/chromium/ui/base/DeviceFormFactor.java b/ui
          return detectScreenWidthBucket(context) >= SCREEN_BUCKET_TABLET;
      }
  
--- 
-2.20.1
-
+--
+2.25.1

+ 16 - 17
build/patches/Add-option-to-not-persist-tabs-across-sessions.patch

@@ -12,7 +12,7 @@ Subject: Add option to not persist tabs across sessions
 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
-@@ -37,6 +37,11 @@
+@@ -42,6 +42,11 @@
          android:title="@string/always_incognito_title"
          android:summary="@string/always_incognito_summary"
          android:defaultValue="false" />
@@ -27,7 +27,7 @@ diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/androi
 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
 +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
-@@ -1185,8 +1185,10 @@ public class ChromeTabbedActivity extends ChromeActivity<ChromeActivityComponent
+@@ -1191,8 +1191,10 @@ public class ChromeTabbedActivity extends ChromeActivity<ChromeActivityComponent
              boolean hadCipherData =
                      CipherFactory.getInstance().restoreFromBundle(getSavedInstanceState());
  
@@ -59,16 +59,16 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting
  import org.chromium.chrome.R;
  import org.chromium.chrome.browser.feedback.HelpAndFeedbackLauncherImpl;
  import org.chromium.chrome.browser.flags.ChromeFeatureList;
-@@ -59,6 +62,8 @@ public class PrivacySettings
-     private static final String PREF_PRIVACY_SANDBOX = "privacy_sandbox";
+@@ -63,6 +66,8 @@ public class PrivacySettings
      private static final String PREF_PRIVACY_REVIEW = "privacy_review";
+     private static final String PREF_INCOGNITO_LOCK = "incognito_lock";
  
 +    private static final String PREF_CLOSE_TABS_ON_EXIT = "close_tabs_on_exit";
 +
      private ManagedPreferenceDelegate mManagedPreferenceDelegate;
+     private IncognitoLockSettings mIncognitoLockSettings;
  
-     @Override
-@@ -136,7 +141,11 @@ public class PrivacySettings
+@@ -150,7 +155,11 @@ public class PrivacySettings
      @Override
      public boolean onPreferenceChange(Preference preference, Object newValue) {
          String key = preference.getKey();
@@ -80,23 +80,23 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting
 +        } else if (PREF_CAN_MAKE_PAYMENT.equals(key)) {
              UserPrefs.get(Profile.getLastUsedRegularProfile())
                      .setBoolean(Pref.CAN_MAKE_PAYMENT_ENABLED, (boolean) newValue);
-         } else if (PREF_NETWORK_PREDICTIONS.equals(key)) {
+         } else if (PREF_HTTPS_FIRST_MODE.equals(key)) {
 @@ -188,6 +197,11 @@ public class PrivacySettings
-             privacySandboxPreference.setSummary(
-                     PrivacySandboxSettingsFragment.getStatusString(getContext()));
+                             : R.string.text_off);
          }
-+
+ 
 +        ChromeSwitchPreference closeTabsOnExitPref =
 +                (ChromeSwitchPreference) findPreference(PREF_CLOSE_TABS_ON_EXIT);
 +        closeTabsOnExitPref.setOnPreferenceChangeListener(this);
 +        closeTabsOnExitPref.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
-     }
- 
-     private ChromeManagedPreferenceDelegate createManagedPreferenceDelegate() {
++
+         Preference secureDnsPref = findPreference(PREF_SECURE_DNS);
+         if (secureDnsPref != null && secureDnsPref.isVisible()) {
+             secureDnsPref.setSummary(SecureDnsSettings.getSummary(getContext()));
 diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
 --- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
 +++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
-@@ -4081,6 +4081,12 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
+@@ -4297,6 +4297,12 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
        <message name="IDS_CONTEXTMENU_IMAGE_TITLE" desc="The title of a context menu tab when the item pressed contains more than one type. This indicates that all the actions are related to the image.">
          IMAGE
        </message>
@@ -109,6 +109,5 @@ diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chro
        <message name="IDS_CONTEXTMENU_LINK_TITLE" desc="The title of a context menu tab when the item pressed contains more than one type. This indicates that all the actions are related to the link.">
          LINK
        </message>
--- 
-2.20.1
-
+--
+2.25.1

+ 205 - 0
build/patches/Add-option-to-use-home-page-as-NTP.patch

@@ -0,0 +1,205 @@
+From: csagan5 <32685696+csagan5@users.noreply.github.com>
+Date: Sat, 20 Nov 2021 15:36:54 +0000
+Subject: Add option to use home page as NTP
+
+And allow use about:blank as default homepage
+---
+ .../java/res/xml/homepage_preferences.xml        |  5 +++++
+ .../chrome/browser/homepage/HomepageManager.java | 16 ++++++++++++++++
+ .../homepage/settings/HomepageSettings.java      | 12 ++++++++++++
+ .../chrome/browser/metrics/LaunchMetrics.java    |  1 -
+ .../browser/tabmodel/ChromeTabCreator.java       |  7 +++++++
+ .../preferences/ChromePreferenceKeys.java        |  1 +
+ .../preferences/LegacyChromePreferenceKeys.java  |  1 +
+ .../android/strings/android_chrome_strings.grd   |  3 +++
+ chrome/browser/ui/browser_ui_prefs.cc            |  2 ++
+ chrome/common/pref_names.cc                      |  4 ++++
+ chrome/common/pref_names.h                       |  1 +
+ 11 files changed, 52 insertions(+), 1 deletion(-)
+
+diff --git a/chrome/android/java/res/xml/homepage_preferences.xml b/chrome/android/java/res/xml/homepage_preferences.xml
+--- a/chrome/android/java/res/xml/homepage_preferences.xml
++++ b/chrome/android/java/res/xml/homepage_preferences.xml
+@@ -12,6 +12,11 @@
+         android:summaryOn="@string/text_on"
+         android:summaryOff="@string/text_off" />
+ 
++    <org.chromium.components.browser_ui.settings.ChromeSwitchPreference
++        android:key="ntp_is_homepage_switch"
++        android:summaryOn="@string/options_ntp_is_homepage_label"
++        android:summaryOff="@string/options_ntp_is_homepage_label" />
++
+     <org.chromium.chrome.browser.homepage.settings.RadioButtonGroupHomepagePreference
+         android:key="homepage_radio_group"
+         android:selectable="false"
+diff --git a/chrome/android/java/src/org/chromium/chrome/browser/homepage/HomepageManager.java b/chrome/android/java/src/org/chromium/chrome/browser/homepage/HomepageManager.java
+--- a/chrome/android/java/src/org/chromium/chrome/browser/homepage/HomepageManager.java
++++ b/chrome/android/java/src/org/chromium/chrome/browser/homepage/HomepageManager.java
+@@ -214,6 +214,22 @@ public class HomepageManager implements HomepagePolicyManager.HomepagePolicyStat
+         notifyHomepageUpdated();
+     }
+ 
++    /**
++     * Returns the user preference for whether the New Tab Page is the homepage or not.
++     *
++     */
++    public boolean getPrefNTPIsHomepageEnabled() {
++        return mSharedPreferencesManager.readBoolean(ChromePreferenceKeys.HOMEPAGE_NTP_IS_HOMEPAGE, false);
++    }
++
++    /**
++     * Sets the user preference for whether the new tab page is the homepage or not.
++     */
++    public void setPrefNTPIsHomepageEnabled(boolean enabled) {
++        mSharedPreferencesManager.writeBoolean(ChromePreferenceKeys.HOMEPAGE_NTP_IS_HOMEPAGE, enabled);
++        notifyHomepageUpdated();
++    }
++
+     /**
+      * @return User specified homepage custom URI string.
+      */
+diff --git a/chrome/android/java/src/org/chromium/chrome/browser/homepage/settings/HomepageSettings.java b/chrome/android/java/src/org/chromium/chrome/browser/homepage/settings/HomepageSettings.java
+--- a/chrome/android/java/src/org/chromium/chrome/browser/homepage/settings/HomepageSettings.java
++++ b/chrome/android/java/src/org/chromium/chrome/browser/homepage/settings/HomepageSettings.java
+@@ -22,6 +22,7 @@ import org.chromium.components.browser_ui.settings.ChromeSwitchPreference;
+ import org.chromium.components.browser_ui.settings.SettingsUtils;
+ import org.chromium.components.embedder_support.util.UrlUtilities;
+ import org.chromium.components.url_formatter.UrlFormatter;
++import org.chromium.components.embedder_support.util.UrlConstants;
+ 
+ /**
+  * Fragment that allows the user to configure homepage related preferences.
+@@ -32,6 +33,8 @@ public class HomepageSettings extends PreferenceFragmentCompat {
+     @VisibleForTesting
+     public static final String PREF_HOMEPAGE_RADIO_GROUP = "homepage_radio_group";
+ 
++    private static final String PREF_NTP_HOMEPAGE_SWITCH = "ntp_is_homepage_switch";
++
+     /**
+      * Delegate used to mark that the homepage is being managed.
+      * Created for {@link org.chromium.chrome.browser.settings.HomepagePreferences}
+@@ -72,6 +75,15 @@ public class HomepageSettings extends PreferenceFragmentCompat {
+         });
+         mRadioButtons.setupPreferenceValues(createPreferenceValuesForRadioGroup());
+ 
++        ChromeSwitchPreference mNTPIsHomepageSwitch =
++                (ChromeSwitchPreference) findPreference(PREF_NTP_HOMEPAGE_SWITCH);
++        boolean isHomepageNTPEnabled = mHomepageManager.getPrefNTPIsHomepageEnabled();
++        mNTPIsHomepageSwitch.setChecked(isHomepageNTPEnabled);
++        mNTPIsHomepageSwitch.setOnPreferenceChangeListener((preference, newValue) -> {
++            mHomepageManager.setPrefNTPIsHomepageEnabled((boolean) newValue);
++            return true;
++        });
++
+         RecordUserAction.record("Settings.Homepage.Opened");
+     }
+ 
+diff --git a/chrome/android/java/src/org/chromium/chrome/browser/metrics/LaunchMetrics.java b/chrome/android/java/src/org/chromium/chrome/browser/metrics/LaunchMetrics.java
+--- a/chrome/android/java/src/org/chromium/chrome/browser/metrics/LaunchMetrics.java
++++ b/chrome/android/java/src/org/chromium/chrome/browser/metrics/LaunchMetrics.java
+@@ -103,7 +103,6 @@ public class LaunchMetrics {
+             boolean showHomeButton, boolean homepageIsNtp, String homepageUrl) {
+         if (homepageUrl == null) {
+             homepageUrl = "";
+-            assert !showHomeButton : "Homepage should be disabled for a null URL";
+         }
+         LaunchMetricsJni.get().recordHomePageLaunchMetrics(
+                 showHomeButton, homepageIsNtp, homepageUrl);
+diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreator.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreator.java
+--- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreator.java
++++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreator.java
+@@ -20,6 +20,7 @@ import org.chromium.chrome.browser.ServiceTabLauncher;
+ import org.chromium.chrome.browser.app.tab_activity_glue.ReparentingDelegateFactory;
+ import org.chromium.chrome.browser.app.tab_activity_glue.ReparentingTask;
+ import org.chromium.chrome.browser.compositor.CompositorViewHolder;
++import org.chromium.chrome.browser.homepage.HomepageManager;
+ import org.chromium.chrome.browser.init.StartupTabPreloader;
+ import org.chromium.chrome.browser.ntp.NewTabPageLaunchOrigin;
+ import org.chromium.chrome.browser.ntp.NewTabPageUtils;
+@@ -327,6 +328,12 @@ public class ChromeTabCreator extends TabCreator {
+      * @return the created tab.
+      */
+     public Tab launchUrl(String url, @TabLaunchType int type, Intent intent, long intentTimestamp) {
++        if (!mIncognito && url.equals(UrlConstants.NTP_URL)) {
++            if (HomepageManager.getInstance().getPrefNTPIsHomepageEnabled()) {
++                url = HomepageManager.getInstance().getHomepageUri();
++            }
++        }
++
+         LoadUrlParams loadUrlParams = new LoadUrlParams(url);
+         loadUrlParams.setIntentReceivedTimestamp(intentTimestamp);
+         return createNewTab(loadUrlParams, type, null, intent);
+diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java
+--- a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java
++++ b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/ChromePreferenceKeys.java
+@@ -518,6 +518,7 @@ public final class ChromePreferenceKeys {
+     public static final String HOMEPAGE_USE_DEFAULT_URI = "homepage_partner_enabled";
+     public static final String HOMEPAGE_PARTNER_CUSTOMIZED_DEFAULT_URI =
+             "Chrome.Homepage.PartnerCustomizedDefaultUri";
++    public static final String HOMEPAGE_NTP_IS_HOMEPAGE = "newtabpage_is_homepage";
+ 
+     /**
+      * Key used to save homepage location set by enterprise policy
+diff --git a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/LegacyChromePreferenceKeys.java b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/LegacyChromePreferenceKeys.java
+--- a/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/LegacyChromePreferenceKeys.java
++++ b/chrome/browser/preferences/android/java/src/org/chromium/chrome/browser/preferences/LegacyChromePreferenceKeys.java
+@@ -103,6 +103,7 @@ public class LegacyChromePreferenceKeys {
+                 ChromePreferenceKeys.HOMEPAGE_CUSTOM_URI,
+                 ChromePreferenceKeys.HOMEPAGE_ENABLED,
+                 ChromePreferenceKeys.HOMEPAGE_USE_DEFAULT_URI,
++                ChromePreferenceKeys.HOMEPAGE_NTP_IS_HOMEPAGE,
+                 ChromePreferenceKeys.INCOGNITO_SHORTCUT_ADDED,
+                 ChromePreferenceKeys.LATEST_UNSUPPORTED_VERSION,
+                 ChromePreferenceKeys.LOCALE_MANAGER_AUTO_SWITCH,
+diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
+--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
++++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
+@@ -1061,6 +1061,9 @@ Your Google account may have other forms of browsing history like searches and a
+       <message name="IDS_CLEAR_BROWSING_DATA_TAB_PERIOD_HOUR" desc="The option to delete browsing data from the last hour.">
+         Last hour
+       </message>
++      <message name="IDS_OPTIONS_NTP_IS_HOMEPAGE_LABEL" desc="The label for switch that allows the user to toggle whether opening a new tab leads to the new tab page or the home page.">
++        Use for new tabs
++      </message>
+       <message name="IDS_CLEAR_BROWSING_DATA_TAB_PERIOD_24_HOURS" desc="The option to delete browsing data from the last 24 hours.">
+         Last 24 hours
+       </message>
+diff --git a/chrome/browser/ui/browser_ui_prefs.cc b/chrome/browser/ui/browser_ui_prefs.cc
+--- a/chrome/browser/ui/browser_ui_prefs.cc
++++ b/chrome/browser/ui/browser_ui_prefs.cc
+@@ -65,6 +65,8 @@ void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) {
+                                 GetHomeButtonAndHomePageIsNewTabPageFlags());
+   registry->RegisterBooleanPref(prefs::kShowHomeButton, false,
+                                 GetHomeButtonAndHomePageIsNewTabPageFlags());
++  registry->RegisterBooleanPref(prefs::kNewTabPageIsHomePage, false,
++                                GetHomeButtonAndHomePageIsNewTabPageFlags());
+ 
+   registry->RegisterInt64Pref(prefs::kDefaultBrowserLastDeclined, 0);
+   bool reset_check_default = false;
+diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc
+--- a/chrome/common/pref_names.cc
++++ b/chrome/common/pref_names.cc
+@@ -55,6 +55,10 @@ const char kForceEphemeralProfiles[] = "profile.ephemeral_mode";
+ // A boolean specifying whether the New Tab page is the home page or not.
+ const char kHomePageIsNewTabPage[] = "homepage_is_newtabpage";
+ 
++// A boolean specifying whether opening a new tab should open the Home page
++// instead of the New Tab page.
++const char kNewTabPageIsHomePage[] = "newtabpage_is_homepage";
++
+ // This is the URL of the page to load when opening new tabs.
+ const char kHomePage[] = "homepage";
+ 
+diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h
+--- a/chrome/common/pref_names.h
++++ b/chrome/common/pref_names.h
+@@ -362,6 +362,7 @@ extern const char kExternalStorageReadOnly[];
+ extern const char kSettingsShowOSBanner[];
+ #endif  // defined(OS_CHROMEOS)
+ extern const char kShowHomeButton[];
++extern const char kNewTabPageIsHomePage[];
+ extern const char kSpeechRecognitionFilterProfanities[];
+ extern const char kAllowDeletingBrowserHistory[];
+ extern const char kForceGoogleSafeSearch[];
+--
+2.25.1

+ 7 - 8
build/patches/Add-support-for-ISupportHelpAndFeedback.patch

@@ -10,15 +10,15 @@ Subject: Add support for ISupportHelpAndFeedback
 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java
 --- a/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java
 +++ b/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java
-@@ -56,6 +56,7 @@ import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager;
- import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager.SnackbarManageable;
+@@ -58,6 +58,7 @@ import org.chromium.components.browser_ui.bottomsheet.BottomSheetController;
+ import org.chromium.components.browser_ui.bottomsheet.BottomSheetControllerFactory;
  import org.chromium.components.browser_ui.settings.FragmentSettingsLauncher;
  import org.chromium.components.browser_ui.settings.SettingsLauncher;
 +import org.chromium.components.browser_ui.settings.SettingsUtils;
  import org.chromium.components.browser_ui.site_settings.SiteSettingsPreferenceFragment;
- import org.chromium.ui.UiUtils;
- 
-@@ -252,9 +253,13 @@ public class SettingsActivity extends ChromeBaseAppCompatActivity
+ import org.chromium.components.browser_ui.widget.scrim.ScrimCoordinator;
+ import org.chromium.ui.KeyboardVisibilityDelegate;
+@@ -287,9 +288,13 @@ public class SettingsActivity extends ChromeBaseAppCompatActivity
              finish();
              return true;
          } else if (item.getItemId() == R.id.menu_id_general_help) {
@@ -47,6 +47,5 @@ diff --git a/components/browser_ui/settings/android/java/src/org/chromium/compon
 +        void onHelpAndFeebackPressed();
 +    }
  }
--- 
-2.20.1
-
+--
+2.25.1

+ 238 - 78
build/patches/Allow-building-without-enable_reporting.patch

@@ -3,76 +3,177 @@ Date: Fri, 22 May 2020 22:43:27 -0400
 Subject: Allow building without enable_reporting
 
 ---
- content/browser/BUILD.gn                                 | 8 ++++----
- content/browser/devtools/protocol/network_handler.cc     | 2 ++
- content/browser/devtools/protocol/network_handler.h      | 2 ++
- .../common/content_switch_dependent_feature_overrides.cc | 3 +++
- services/network/network_context.cc                      | 2 +-
- services/network/public/mojom/BUILD.gn                   | 3 +++
- third_party/blink/renderer/core/frame/local_frame.cc     | 3 +++
- third_party/blink/renderer/core/frame/local_frame.h      | 6 +++---
- .../blink/renderer/core/frame/reporting_context.cc       | 9 +++++++++
- .../blink/renderer/core/frame/reporting_context.h        | 7 +++++--
- 10 files changed, 35 insertions(+), 10 deletions(-)
+ .../devtools/protocol/network_handler.cc       |  2 ++
+ .../cross_origin_embedder_policy_reporter.cc   |  3 ++-
+ .../net/cross_origin_opener_policy_reporter.cc | 16 +++++++---------
+ .../renderer_host/render_frame_host_impl.cc    |  2 ++
+ .../web_package/signed_exchange_reporter.cc    |  2 ++
+ ...ntent_switch_dependent_feature_overrides.cc |  1 +
+ net/reporting/reporting_service.cc             |  6 ++++++
+ services/network/network_context.cc            | 18 +-----------------
+ services/network/network_context.h             | 11 -----------
+ services/network/public/mojom/BUILD.gn         |  1 -
+ .../network/public/mojom/network_context.mojom |  2 ++
+ .../blink/renderer/core/frame/local_frame.cc   |  3 +++
+ .../blink/renderer/core/frame/local_frame.h    |  6 +++---
+ .../renderer/core/frame/reporting_context.cc   |  9 +++++++++
+ .../renderer/core/frame/reporting_context.h    |  7 +++++--
+ 15 files changed, 45 insertions(+), 44 deletions(-)
 
-diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
---- a/content/browser/BUILD.gn
-+++ b/content/browser/BUILD.gn
-@@ -1251,6 +1251,10 @@ source_set("browser") {
-     "net/browser_online_state_observer.cc",
-     "net/browser_online_state_observer.h",
-     "net/cookie_store_factory.cc",
-+    "net/cross_origin_embedder_policy_reporter.cc",
-+    "net/cross_origin_embedder_policy_reporter.h",
-+    "net/cross_origin_opener_policy_reporter.cc",
-+    "net/cross_origin_opener_policy_reporter.h",
-     "net/network_errors_listing_ui.cc",
-     "net/network_errors_listing_ui.h",
-     "net/network_quality_observer_impl.cc",
-@@ -3009,10 +3013,6 @@ source_set("browser") {
- 
-   if (enable_reporting) {
-     sources += [
--      "net/cross_origin_embedder_policy_reporter.cc",
--      "net/cross_origin_embedder_policy_reporter.h",
--      "net/cross_origin_opener_policy_reporter.cc",
--      "net/cross_origin_opener_policy_reporter.h",
-       "net/reporting_service_proxy.cc",
-       "net/reporting_service_proxy.h",
-     ]
 diff --git a/content/browser/devtools/protocol/network_handler.cc b/content/browser/devtools/protocol/network_handler.cc
 --- a/content/browser/devtools/protocol/network_handler.cc
 +++ b/content/browser/devtools/protocol/network_handler.cc
-@@ -451,6 +451,7 @@ std::vector<GURL> ComputeCookieURLs(RenderFrameHostImpl* frame_host,
-   return urls;
+@@ -1283,6 +1283,7 @@ String BuildReportStatus(const net::ReportingReport::Status status) {
+   }
  }
  
 +#if BUILDFLAG(ENABLE_REPORTING)
  std::vector<GURL> ComputeReportingURLs(RenderFrameHostImpl* frame_host) {
    std::vector<GURL> urls;
    base::queue<FrameTreeNode*> queue;
-@@ -468,6 +469,7 @@ std::vector<GURL> ComputeReportingURLs(RenderFrameHostImpl* frame_host) {
+@@ -1300,6 +1301,7 @@ std::vector<GURL> ComputeReportingURLs(RenderFrameHostImpl* frame_host) {
    }
    return urls;
  }
 +#endif  // BUILDFLAG(ENABLE_REPORTING)
  
- String resourcePriority(net::RequestPriority priority) {
-   switch (priority) {
-diff --git a/content/browser/devtools/protocol/network_handler.h b/content/browser/devtools/protocol/network_handler.h
---- a/content/browser/devtools/protocol/network_handler.h
-+++ b/content/browser/devtools/protocol/network_handler.h
-@@ -304,8 +304,10 @@ class NetworkHandler : public DevToolsDomainHandler,
-       Response response,
-       mojo::ScopedDataPipeConsumerHandle pipe,
-       const std::string& mime_type);
+ }  // namespace
+ 
+diff --git a/content/browser/net/cross_origin_embedder_policy_reporter.cc b/content/browser/net/cross_origin_embedder_policy_reporter.cc
+--- a/content/browser/net/cross_origin_embedder_policy_reporter.cc
++++ b/content/browser/net/cross_origin_embedder_policy_reporter.cc
+@@ -112,6 +112,7 @@ void CrossOriginEmbedderPolicyReporter::QueueAndNotify(
+         kType, context_url_, blink::mojom::ReportBody::New(std::move(list))));
+   }
+   if (endpoint) {
 +#if BUILDFLAG(ENABLE_REPORTING)
-   std::unique_ptr<protocol::Network::ReportingApiReport> BuildProtocolReport(
-       const net::ReportingReport& report);
-+#endif  // BUILDFLAG(ENABLE_REPORTING)
+     base::DictionaryValue body_to_pass;
+     for (const auto& pair : body) {
+       body_to_pass.SetString(pair.first, pair.second);
+@@ -123,7 +124,7 @@ void CrossOriginEmbedderPolicyReporter::QueueAndNotify(
+           kType, *endpoint, context_url_, reporting_source_,
+           network_isolation_key_,
+           /*user_agent=*/absl::nullopt, std::move(body_to_pass));
+-    }
++#endif
+   }
+ }
+ 
+diff --git a/content/browser/net/cross_origin_opener_policy_reporter.cc b/content/browser/net/cross_origin_opener_policy_reporter.cc
+--- a/content/browser/net/cross_origin_opener_policy_reporter.cc
++++ b/content/browser/net/cross_origin_opener_policy_reporter.cc
+@@ -17,25 +17,17 @@
+ #include "services/network/public/mojom/network_context.mojom.h"
+ #include "services/network/public/mojom/source_location.mojom.h"
+ #include "url/origin.h"
++#include "build/build_config.h"
+ 
+ namespace content {
+ 
+ namespace {
  
-   // TODO(dgozman): Remove this.
-   const std::string host_id_;
+ // Report attribute names (camelCase):
+-constexpr char kColumnNumber[] = "columnNumber";
+ constexpr char kDisposition[] = "disposition";
+-constexpr char kEffectivePolicy[] = "effectivePolicy";
+-constexpr char kInitialPopupURL[] = "initialPopupURL";
+-constexpr char kLineNumber[] = "lineNumber";
+ constexpr char kNextURL[] = "nextResponseURL";
+-constexpr char kOpeneeURL[] = "openeeURL";
+-constexpr char kOpenerURL[] = "openerURL";
+-constexpr char kOtherDocumentURL[] = "otherDocumentURL";
+ constexpr char kPreviousURL[] = "previousResponseURL";
+-constexpr char kProperty[] = "property";
+ constexpr char kReferrer[] = "referrer";
+-constexpr char kSourceFile[] = "sourceFile";
+ constexpr char kType[] = "type";
+ 
+ // Report attribute values:
+@@ -44,6 +36,7 @@ constexpr char kDispositionReporting[] = "reporting";
+ constexpr char kTypeFromResponse[] = "navigation-from-response";
+ constexpr char kTypeToResponse[] = "navigation-to-response";
+ 
++#if BUILDFLAG(ENABLE_REPORTING)
+ std::string ToString(network::mojom::CrossOriginOpenerPolicyValue coop_value) {
+   switch (coop_value) {
+     case network::mojom::CrossOriginOpenerPolicyValue::kUnsafeNone:
+@@ -56,6 +49,7 @@ std::string ToString(network::mojom::CrossOriginOpenerPolicyValue coop_value) {
+       return "same-origin-plus-coep";
+   }
+ }
++#endif
+ 
+ FrameTreeNode* TopLevelOpener(FrameTreeNode* frame) {
+   FrameTreeNode* opener = frame->original_opener();
+@@ -226,6 +220,7 @@ void CrossOriginOpenerPolicyReporter::QueueAccessReport(
+     network::mojom::SourceLocationPtr source_location,
+     const std::string& reported_window_url,
+     const std::string& initial_popup_url) const {
++#if BUILDFLAG(ENABLE_REPORTING)
+   // Cross-Origin-Opener-Policy-Report-Only is not required to provide
+   // endpoints.
+   if (!coop_.report_only_reporting_endpoint)
+@@ -274,12 +269,14 @@ void CrossOriginOpenerPolicyReporter::QueueAccessReport(
+   storage_partition_->GetNetworkContext()->QueueReport(
+       "coop", endpoint, context_url_, reporting_source_, network_isolation_key_,
+       absl::nullopt, std::move(body));
++#endif
+ }
+ 
+ void CrossOriginOpenerPolicyReporter::QueueNavigationReport(
+     base::DictionaryValue body,
+     const std::string& endpoint,
+     bool is_report_only) {
++#if BUILDFLAG(ENABLE_REPORTING)
+   body.SetString(kDisposition,
+                  is_report_only ? kDispositionReporting : kDispositionEnforce);
+   body.SetString(
+@@ -288,6 +285,7 @@ void CrossOriginOpenerPolicyReporter::QueueNavigationReport(
+   storage_partition_->GetNetworkContext()->QueueReport(
+       "coop", endpoint, context_url_, reporting_source_, network_isolation_key_,
+       /*user_agent=*/absl::nullopt, std::move(body));
++#endif
+ }
+ 
+ }  // namespace content
+diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc
+--- a/content/browser/renderer_host/render_frame_host_impl.cc
++++ b/content/browser/renderer_host/render_frame_host_impl.cc
+@@ -10827,6 +10827,7 @@ void RenderFrameHostImpl::OnSameDocumentCommitProcessed(
+ void RenderFrameHostImpl::MaybeGenerateCrashReport(
+     base::TerminationStatus status,
+     int exit_code) {
++#if BUILDFLAG(ENABLE_REPORTING)
+   if (!last_committed_url_.SchemeIsHTTPOrHTTPS())
+     return;
+ 
+@@ -10876,6 +10877,7 @@ void RenderFrameHostImpl::MaybeGenerateCrashReport(
+       /*type=*/"crash", /*group=*/"default", last_committed_url_,
+       GetReportingSource(), isolation_info_.network_isolation_key(),
+       absl::nullopt /* user_agent */, std::move(body));
++#endif
+ }
+ 
+ void RenderFrameHostImpl::SendCommitNavigation(
+diff --git a/content/browser/web_package/signed_exchange_reporter.cc b/content/browser/web_package/signed_exchange_reporter.cc
+--- a/content/browser/web_package/signed_exchange_reporter.cc
++++ b/content/browser/web_package/signed_exchange_reporter.cc
+@@ -125,6 +125,7 @@ bool ShouldDowngradeReport(const char* result_string,
+ void ReportResult(int frame_tree_node_id,
+                   network::mojom::SignedExchangeReportPtr report,
+                   const net::NetworkIsolationKey& network_isolation_key) {
++#if BUILDFLAG(ENABLE_REPORTING)
+   FrameTreeNode* frame_tree_node =
+       FrameTreeNode::GloballyFindByID(frame_tree_node_id);
+   if (!frame_tree_node)
+@@ -139,6 +140,7 @@ void ReportResult(int frame_tree_node_id,
+   DCHECK(partition);
+   partition->GetNetworkContext()->QueueSignedExchangeReport(
+       std::move(report), network_isolation_key);
++#endif
+ }
+ 
+ }  // namespace
 diff --git a/content/public/common/content_switch_dependent_feature_overrides.cc b/content/public/common/content_switch_dependent_feature_overrides.cc
 --- a/content/public/common/content_switch_dependent_feature_overrides.cc
 +++ b/content/public/common/content_switch_dependent_feature_overrides.cc
@@ -84,22 +185,26 @@ diff --git a/content/public/common/content_switch_dependent_feature_overrides.cc
  #include "services/network/public/cpp/features.h"
  #include "services/network/public/cpp/network_switches.h"
  #include "third_party/blink/public/common/features.h"
-@@ -40,9 +41,11 @@ GetSwitchDependentFeatureOverrides(const base::CommandLine& command_line) {
-       {switches::kEnableExperimentalWebPlatformFeatures,
-        std::cref(features::kDocumentPolicyNegotiation),
-        base::FeatureList::OVERRIDE_ENABLE_FEATURE},
+diff --git a/net/reporting/reporting_service.cc b/net/reporting/reporting_service.cc
+--- a/net/reporting/reporting_service.cc
++++ b/net/reporting/reporting_service.cc
+@@ -211,6 +211,12 @@ class ReportingServiceImpl : public ReportingService {
+       std::unique_ptr<const base::Value> body,
+       int depth,
+       base::TimeTicks queued_ticks) {
 +#if BUILDFLAG(ENABLE_REPORTING)
-       {switches::kEnableExperimentalWebPlatformFeatures,
-        std::cref(net::features::kDocumentReporting),
-        base::FeatureList::OVERRIDE_ENABLE_FEATURE},
++    if ((true))
++      return;
++#else
++#error Attempting to build with enable_reporting
 +#endif
-       {switches::kEnableExperimentalWebPlatformFeatures,
-        std::cref(features::kExperimentalContentSecurityPolicyFeatures),
-        base::FeatureList::OVERRIDE_ENABLE_FEATURE},
+     DCHECK(initialized_);
+     context_->cache()->AddReport(
+         reporting_source, network_isolation_key, sanitized_url, user_agent,
 diff --git a/services/network/network_context.cc b/services/network/network_context.cc
 --- a/services/network/network_context.cc
 +++ b/services/network/network_context.cc
-@@ -1118,7 +1118,7 @@ void NetworkContext::SetDocumentReportingEndpoints(
+@@ -1151,25 +1151,9 @@ void NetworkContext::SetDocumentReportingEndpoints(
  
  void NetworkContext::SendReportsAndRemoveSource(
      const base::UnguessableToken& reporting_source) {
@@ -107,20 +212,76 @@ diff --git a/services/network/network_context.cc b/services/network/network_cont
 +  // NOTREACHED(); removed for build in debug
  }
  
- void NetworkContext::QueueReport(
+-void NetworkContext::QueueReport(
+-    const std::string& type,
+-    const std::string& group,
+-    const GURL& url,
+-    const absl::optional<base::UnguessableToken>& reporting_source,
+-    const net::NetworkIsolationKey& network_isolation_key,
+-    const absl::optional<std::string>& user_agent,
+-    base::Value body) {
+-  NOTREACHED();
+-}
+-
+-void NetworkContext::QueueSignedExchangeReport(
+-    mojom::SignedExchangeReportPtr report,
+-    const net::NetworkIsolationKey& network_isolation_key) {
+-  NOTREACHED();
+-}
+ #endif  // BUILDFLAG(ENABLE_REPORTING)
+ 
+ void NetworkContext::ClearDomainReliability(
+diff --git a/services/network/network_context.h b/services/network/network_context.h
+--- a/services/network/network_context.h
++++ b/services/network/network_context.h
+@@ -424,17 +424,6 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
+       const base::flat_map<std::string, std::string>& endpoints) override;
+   void SendReportsAndRemoveSource(
+       const base::UnguessableToken& reporting_source) override;
+-  void QueueReport(
+-      const std::string& type,
+-      const std::string& group,
+-      const GURL& url,
+-      const absl::optional<base::UnguessableToken>& reporting_source,
+-      const net::NetworkIsolationKey& network_isolation_key,
+-      const absl::optional<std::string>& user_agent,
+-      base::Value body) override;
+-  void QueueSignedExchangeReport(
+-      mojom::SignedExchangeReportPtr report,
+-      const net::NetworkIsolationKey& network_isolation_key) override;
+   void AddDomainReliabilityContextForTesting(
+       const GURL& origin,
+       const GURL& upload_url,
 diff --git a/services/network/public/mojom/BUILD.gn b/services/network/public/mojom/BUILD.gn
 --- a/services/network/public/mojom/BUILD.gn
 +++ b/services/network/public/mojom/BUILD.gn
-@@ -888,6 +888,9 @@ mojom("mojom") {
-     export_class_attribute_blink = "BLINK_PLATFORM_EXPORT"
+@@ -950,7 +950,6 @@ mojom("mojom") {
      export_define_blink = "BLINK_PLATFORM_IMPLEMENTATION=1"
      export_header_blink = "third_party/blink/public/platform/web_common.h"
-+  }
-+
-+  if (enable_reporting) {
-     enabled_features += [ "enable_reporting" ]
+     if (enable_reporting) {
+-      enabled_features += [ "enable_reporting" ]
+     }
    }
  
+diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
+--- a/services/network/public/mojom/network_context.mojom
++++ b/services/network/public/mojom/network_context.mojom
+@@ -1000,6 +1000,7 @@ interface NetworkContext {
+   // provided |network_isolation_key|.
+   //
+   // Spec: https://w3c.github.io/reporting/#concept-reports
++  [EnableIf=enable_reporting]
+   QueueReport(string type,
+               string group,
+               url.mojom.Url url,
+@@ -1013,6 +1014,7 @@ interface NetworkContext {
+   // Note that this queued report will never be delivered if no reporting
+   // endpoint matching is registered for with the provided
+   // |network_isolation_key|.
++  [EnableIf=enable_reporting]
+   QueueSignedExchangeReport(SignedExchangeReport report,
+                             NetworkIsolationKey network_isolation_key);
+ 
 diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc
 --- a/third_party/blink/renderer/core/frame/local_frame.cc
 +++ b/third_party/blink/renderer/core/frame/local_frame.cc
@@ -132,7 +293,7 @@ diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/
  #include "services/data_decoder/public/mojom/resource_snapshot_for_web_bundle.mojom-blink.h"
  #include "services/network/public/cpp/features.h"
  #include "services/network/public/mojom/content_security_policy.mojom-blink.h"
-@@ -2282,9 +2283,11 @@ const base::UnguessableToken& LocalFrame::GetAgentClusterId() const {
+@@ -2287,9 +2288,11 @@ const base::UnguessableToken& LocalFrame::GetAgentClusterId() const {
    return base::UnguessableToken::Null();
  }
  
@@ -158,7 +319,7 @@ diff --git a/third_party/blink/renderer/core/frame/local_frame.h b/third_party/b
  #include "services/device/public/mojom/device_posture_provider.mojom-blink-forward.h"
  #include "services/network/public/mojom/fetch_api.mojom-blink-forward.h"
  #include "third_party/blink/public/common/frame/frame_ad_evidence.h"
-@@ -544,9 +544,9 @@ class CORE_EXPORT LocalFrame final : public Frame,
+@@ -542,9 +542,9 @@ class CORE_EXPORT LocalFrame final
    }
  
    SmoothScrollSequencer& GetSmoothScrollSequencer();
@@ -244,7 +405,7 @@ diff --git a/third_party/blink/renderer/core/frame/reporting_context.h b/third_p
  #include "third_party/blink/public/mojom/frame/reporting_observer.mojom-blink.h"
  #include "third_party/blink/public/mojom/reporting/reporting.mojom-blink.h"
  #include "third_party/blink/renderer/core/core_export.h"
-@@ -53,10 +54,10 @@ class CORE_EXPORT ReportingContext : public GarbageCollected<ReportingContext>,
+@@ -54,10 +55,10 @@ class CORE_EXPORT ReportingContext : public GarbageCollected<ReportingContext>,
   private:
    // Counts the use of a report type via UseCounter.
    void CountReport(Report*);
@@ -257,7 +418,7 @@ diff --git a/third_party/blink/renderer/core/frame/reporting_context.h b/third_p
    void NotifyInternal(Report* report);
    // Send |report| via the Reporting API to |endpoint|.
    void SendToReportingAPI(Report* report, const String& endpoint) const;
-@@ -67,8 +68,10 @@ class CORE_EXPORT ReportingContext : public GarbageCollected<ReportingContext>,
+@@ -68,8 +69,10 @@ class CORE_EXPORT ReportingContext : public GarbageCollected<ReportingContext>,
  
    // This is declared mutable so that the service endpoint can be cached by
    // const methods.
@@ -268,6 +429,5 @@ diff --git a/third_party/blink/renderer/core/frame/reporting_context.h b/third_p
  
    HeapMojoReceiver<mojom::blink::ReportingObserver, ReportingContext> receiver_;
  };
--- 
-2.20.1
-
+--
+2.25.1

+ 74 - 0
build/patches/Allow-building-without-supervised-users.patch

@@ -0,0 +1,74 @@
+From: csagan5 <32685696+csagan5@users.noreply.github.com>
+Date: Mon, 21 Feb 2022 01:24:11 +0100
+Subject: Allow building without supervised users
+
+---
+ .../browser/childaccounts/ChildAccountService.java    | 11 -----------
+ chrome/browser/startup_data.cc                        |  4 +---
+ .../child_accounts/child_account_service_android.cc   |  9 ---------
+ 3 files changed, 1 insertion(+), 23 deletions(-)
+
+diff --git a/chrome/android/java/src/org/chromium/chrome/browser/childaccounts/ChildAccountService.java b/chrome/android/java/src/org/chromium/chrome/browser/childaccounts/ChildAccountService.java
+--- a/chrome/android/java/src/org/chromium/chrome/browser/childaccounts/ChildAccountService.java
++++ b/chrome/android/java/src/org/chromium/chrome/browser/childaccounts/ChildAccountService.java
+@@ -31,21 +31,10 @@ public class ChildAccountService {
+         ThreadUtils.assertOnUiThread();
+         final Activity activity = windowAndroid.getActivity().get();
+         if (activity == null) {
+-            PostTask.postTask(UiThreadTaskTraits.DEFAULT, () -> {
+-                ChildAccountServiceJni.get().onReauthenticationFailed(nativeOnFailureCallback);
+-            });
+             return;
+         }
+         Account account = AccountUtils.createAccountFromName(accountName);
+         AccountManagerFacadeProvider.getInstance().updateCredentials(account, activity, success -> {
+-            if (!success) {
+-                ChildAccountServiceJni.get().onReauthenticationFailed(nativeOnFailureCallback);
+-            }
+         });
+     }
+-
+-    @NativeMethods
+-    interface Natives {
+-        void onReauthenticationFailed(long onFailureCallbackPtr);
+-    }
+ }
+diff --git a/chrome/browser/startup_data.cc b/chrome/browser/startup_data.cc
+--- a/chrome/browser/startup_data.cc
++++ b/chrome/browser/startup_data.cc
+@@ -6,6 +6,7 @@
+ 
+ #include "base/files/file_path.h"
+ #include "base/task/thread_pool.h"
++#include "build/build_config.h"
+ #include "chrome/browser/metrics/chrome_feature_list_creator.h"
+ #include "chrome/browser/prefs/profile_pref_store_manager.h"
+ #include "chrome/common/channel_info.h"
+@@ -33,9 +34,6 @@
+ #include "chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.h"
+ #include "chrome/browser/profiles/pref_service_builder_utils.h"
+ #include "chrome/browser/profiles/profile_key.h"
+-#include "chrome/browser/supervised_user/supervised_user_pref_store.h"
+-#include "chrome/browser/supervised_user/supervised_user_settings_service.h"
+-#include "chrome/browser/supervised_user/supervised_user_settings_service_factory.h"
+ #include "chrome/common/chrome_constants.h"
+ #include "chrome/common/chrome_paths.h"
+ #include "components/keyed_service/content/browser_context_dependency_manager.h"
+diff --git a/chrome/browser/supervised_user/child_accounts/child_account_service_android.cc b/chrome/browser/supervised_user/child_accounts/child_account_service_android.cc
+--- a/chrome/browser/supervised_user/child_accounts/child_account_service_android.cc
++++ b/chrome/browser/supervised_user/child_accounts/child_account_service_android.cc
+@@ -39,12 +39,3 @@ void ReauthenticateChildAccount(
+       env, window_android->GetJavaObject(), ConvertUTF8ToJavaString(env, email),
+       reinterpret_cast<jlong>(callback_copy.release()));
+ }
+-
+-void JNI_ChildAccountService_OnReauthenticationFailed(JNIEnv* env,
+-                                                      jlong jcallbackPtr) {
+-  // Cast the pointer value back to a Callback and take ownership of it.
+-  std::unique_ptr<base::RepeatingCallback<void()>> callback(
+-      reinterpret_cast<base::RepeatingCallback<void()>*>(jcallbackPtr));
+-
+-  callback->Run();
+-}
+--
+2.25.1

+ 5 - 6
build/patches/Allow-playing-audio-in-background.patch

@@ -10,7 +10,7 @@ Subject: Allow playing audio in background
 diff --git a/third_party/blink/public/platform/media/web_media_player_impl.h b/third_party/blink/public/platform/media/web_media_player_impl.h
 --- a/third_party/blink/public/platform/media/web_media_player_impl.h
 +++ b/third_party/blink/public/platform/media/web_media_player_impl.h
-@@ -159,6 +159,9 @@ class BLINK_PLATFORM_EXPORT WebMediaPlayerImpl
+@@ -162,6 +162,9 @@ class BLINK_PLATFORM_EXPORT WebMediaPlayerImpl
    bool HasVideo() const override;
    bool HasAudio() const override;
  
@@ -23,7 +23,7 @@ diff --git a/third_party/blink/public/platform/media/web_media_player_impl.h b/t
 diff --git a/third_party/blink/renderer/platform/media/web_media_player_impl.cc b/third_party/blink/renderer/platform/media/web_media_player_impl.cc
 --- a/third_party/blink/renderer/platform/media/web_media_player_impl.cc
 +++ b/third_party/blink/renderer/platform/media/web_media_player_impl.cc
-@@ -1120,6 +1120,12 @@ bool WebMediaPlayerImpl::HasAudio() const {
+@@ -1186,6 +1186,12 @@ bool WebMediaPlayerImpl::HasAudio() const {
    return pipeline_metadata_.has_audio;
  }
  
@@ -36,7 +36,7 @@ diff --git a/third_party/blink/renderer/platform/media/web_media_player_impl.cc
  void WebMediaPlayerImpl::EnabledAudioTracksChanged(
      const WebVector<WebMediaPlayer::TrackId>& enabledTrackIds) {
    DCHECK(main_task_runner_->BelongsToCurrentThread());
-@@ -3492,7 +3498,11 @@ bool WebMediaPlayerImpl::ShouldPausePlaybackWhenHidden() const {
+@@ -3557,7 +3563,11 @@ bool WebMediaPlayerImpl::ShouldPausePlaybackWhenHidden() const {
    // Audio only stream is allowed to play when in background.
    // TODO: We should check IsBackgroundOptimizationCandidate here. But we need
    // to move the logic of checking video frames out of that function.
@@ -49,6 +49,5 @@ diff --git a/third_party/blink/renderer/platform/media/web_media_player_impl.cc
      return false;
  
    if (using_media_player_renderer_ &&
--- 
-2.20.1
-
+--
+2.25.1

+ 6 - 7
build/patches/Allow-website-sign-in-without-account-sign-in.patch

@@ -10,15 +10,14 @@ Disable prefs::kSigninAllowedOnNextStartup by default. The setting can be found
 diff --git a/chrome/browser/signin/account_consistency_mode_manager.cc b/chrome/browser/signin/account_consistency_mode_manager.cc
 --- a/chrome/browser/signin/account_consistency_mode_manager.cc
 +++ b/chrome/browser/signin/account_consistency_mode_manager.cc
-@@ -127,7 +127,7 @@ void AccountConsistencyModeManager::RegisterProfilePrefs(
- #if BUILDFLAG(ENABLE_DICE_SUPPORT)
-   registry->RegisterBooleanPref(kDiceMigrationCompletePref, false);
- #endif
+@@ -113,7 +113,7 @@ AccountConsistencyModeManager::~AccountConsistencyModeManager() {}
+ // static
+ void AccountConsistencyModeManager::RegisterProfilePrefs(
+     user_prefs::PrefRegistrySyncable* registry) {
 -  registry->RegisterBooleanPref(prefs::kSigninAllowedOnNextStartup, true);
 +  registry->RegisterBooleanPref(prefs::kSigninAllowedOnNextStartup, false);
  }
  
  // static
--- 
-2.20.1
-
+--
+2.25.1

+ 3 - 4
build/patches/Always-allow-partner-customisation.patch

@@ -9,7 +9,7 @@ Subject: Always allow partner customisation
 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/PartnerBrowserCustomizations.java b/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/PartnerBrowserCustomizations.java
 --- a/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/PartnerBrowserCustomizations.java
 +++ b/chrome/android/java/src/org/chromium/chrome/browser/partnercustomizations/PartnerBrowserCustomizations.java
-@@ -324,14 +324,14 @@ public class PartnerBrowserCustomizations {
+@@ -329,14 +329,14 @@ public class PartnerBrowserCustomizations {
              @Override
              protected Void doInBackground() {
                  try {
@@ -32,6 +32,5 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/partnercustomiz
  
                      if (isCancelled()) return null;
                      Provider provider = AppHooks.get().getCustomizationProvider();
--- 
-2.20.1
-
+--
+2.25.1

+ 4 - 5
build/patches/Always-use-new-tab-page-for-default-home-page.patch

@@ -17,9 +17,8 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/homepage/Homepa
 -        if (PartnerBrowserCustomizations.getInstance().isHomepageProviderAvailableAndEnabled()) {
 -            return PartnerBrowserCustomizations.getInstance().getHomePageUrl();
 -        }
-         return UrlConstants.NTP_NON_NATIVE_URL;
-     }
  
--- 
-2.20.1
-
+         String homepagePartnerDefaultUri = SharedPreferencesManager.getInstance().readString(
+                 ChromePreferenceKeys.HOMEPAGE_PARTNER_CUSTOMIZED_DEFAULT_URI, "");
+--
+2.25.1

+ 61 - 0
build/patches/Ask-user-before-closing-all-tabs.patch

@@ -0,0 +1,61 @@
+From: uazo <uazo@users.noreply.github.com>
+Date: Sat, 20 Nov 2021 17:42:41 +0000
+Subject: Ask user before closing all tabs
+
+---
+ .../chrome/browser/ChromeTabbedActivity.java  | 20 +++++++++++++++++--
+ .../strings/android_chrome_strings.grd        |  3 +++
+ 2 files changed, 21 insertions(+), 2 deletions(-)
+
+diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
+--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
++++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
+@@ -33,6 +33,7 @@ import androidx.annotation.VisibleForTesting;
+ import androidx.lifecycle.Lifecycle;
+ import androidx.lifecycle.LifecycleObserver;
+ import androidx.lifecycle.LifecycleRegistry;
++import androidx.appcompat.app.AlertDialog;
+ 
+ import org.chromium.base.CallbackController;
+ import org.chromium.base.CommandLine;
+@@ -2054,8 +2055,23 @@ public class ChromeTabbedActivity extends ChromeActivity<ChromeActivityComponent
+             ApplicationLifetime.terminate(false);
+         } else if (id == R.id.close_all_tabs_menu_id) {
+             // Close both incognito and normal tabs
+-            getTabModelSelector().closeAllTabs();
+-            RecordUserAction.record("MobileMenuCloseAllTabs");
++            AlertDialog.Builder alert =
++                new AlertDialog.Builder(ChromeTabbedActivity.this);
++            AlertDialog alertDialog =
++                alert.setTitle(R.string.menu_close_all_tabs)
++                        .setMessage(R.string.menu_ask_to_close_all_tabs)
++                        .setPositiveButton(android.R.string.ok,
++                            (dialog, which) -> {
++                                getTabModelSelector().closeAllTabs();
++                                dialog.dismiss();
++                            })
++                        .setNegativeButton(android.R.string.cancel,
++                            (dialog, which) -> {
++                                dialog.dismiss();
++                            })
++                        .create();
++            alertDialog.getDelegate().setHandleNativeActionModesEnabled(false);
++            alertDialog.show();
+         } else if (id == R.id.bookmark_all_tabs_menu_id) {
+             bookmarkAllTabs();
+         } else if (id == R.id.close_all_incognito_tabs_menu_id) {
+diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
+--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
++++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
+@@ -3412,6 +3412,9 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
+       <message name="IDS_MENU_CLOSE_ALL_TABS" desc="Menu item for closing all open tabs. [CHAR_LIMIT=27]">
+         Close all tabs
+       </message>
++      <message name="IDS_MENU_ASK_TO_CLOSE_ALL_TABS" desc="Label for the notice of closing all open tabs. [CHAR_LIMIT=27]">
++        Do you want to close all tabs?
++      </message>
+       <message name="IDS_MENU_CLOSE_ALL_INCOGNITO_TABS" desc="Menu item for closing all open Incognito tabs. [CHAR_LIMIT=27]">
+         Close Incognito tabs
+       </message>
+--
+2.25.1

+ 3 - 4
build/patches/AudioBuffer-AnalyserNode-fp-mitigations.patch

@@ -46,7 +46,7 @@ diff --git a/third_party/blink/renderer/modules/webaudio/audio_buffer.idl b/thir
 diff --git a/third_party/blink/renderer/modules/webaudio/audio_context.cc b/third_party/blink/renderer/modules/webaudio/audio_context.cc
 --- a/third_party/blink/renderer/modules/webaudio/audio_context.cc
 +++ b/third_party/blink/renderer/modules/webaudio/audio_context.cc
-@@ -458,7 +458,9 @@ double AudioContext::baseLatency() const {
+@@ -456,7 +456,9 @@ double AudioContext::baseLatency() const {
    DCHECK(IsMainThread());
    DCHECK(destination());
  
@@ -57,6 +57,5 @@ diff --git a/third_party/blink/renderer/modules/webaudio/audio_context.cc b/thir
  }
  
  MediaElementAudioSourceNode* AudioContext::createMediaElementSource(
--- 
-2.20.1
-
+--
+2.25.1

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 291 - 122
build/patches/Automated-domain-substitution.patch


+ 4 - 5
build/patches/Battery-API-return-nothing.patch

@@ -19,12 +19,12 @@ diff --git a/third_party/blink/renderer/modules/battery/battery_manager.cc b/thi
  }
  
  double BatteryManager::chargingTime() {
--  return battery_status_.charging_time();
+-  return battery_status_.charging_time().InSecondsF();
 +  return 0.0;
  }
  
  double BatteryManager::dischargingTime() {
--  return battery_status_.discharging_time();
+-  return battery_status_.discharging_time().InSecondsF();
 +  return std::numeric_limits<double>::infinity();
  }
  
@@ -61,6 +61,5 @@ diff --git a/third_party/blink/renderer/modules/battery/battery_manager.cc b/thi
  }
  
  void BatteryManager::RegisterWithDispatcher() {
--- 
-2.20.1
-
+--
+2.25.1

+ 17 - 14
build/patches/Block-gateway-attacks-via-websockets.patch

@@ -4,15 +4,15 @@ Subject: Block gateway attacks via websockets
 
 ---
  .../renderer/core/loader/base_fetch_context.h |  1 +
- .../core/loader/frame_fetch_context.cc        | 18 +++++++++++++
+ .../core/loader/frame_fetch_context.cc        | 20 ++++++++++++++
  .../core/loader/frame_fetch_context.h         |  1 +
- .../core/loader/worker_fetch_context.cc       | 19 +++++++++++++
+ .../core/loader/worker_fetch_context.cc       | 21 +++++++++++++++
  .../core/loader/worker_fetch_context.h        |  1 +
  .../background_fetch_manager.cc               |  2 --
  .../websockets/websocket_channel_impl.cc      |  5 ++++
  .../modules/websockets/websocket_common.cc    | 27 +++++++++++++++++++
  .../modules/websockets/websocket_common.h     |  4 +++
- 9 files changed, 76 insertions(+), 2 deletions(-)
+ 9 files changed, 80 insertions(+), 2 deletions(-)
 
 diff --git a/third_party/blink/renderer/core/loader/base_fetch_context.h b/third_party/blink/renderer/core/loader/base_fetch_context.h
 --- a/third_party/blink/renderer/core/loader/base_fetch_context.h
@@ -28,7 +28,7 @@ diff --git a/third_party/blink/renderer/core/loader/base_fetch_context.h b/third
 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
-@@ -579,6 +579,24 @@ bool FrameFetchContext::ShouldBlockRequestByInspector(const KURL& url) const {
+@@ -563,6 +563,26 @@ bool FrameFetchContext::ShouldBlockRequestByInspector(const KURL& url) const {
    return should_block_request;
  }
  
@@ -36,6 +36,8 @@ diff --git a/third_party/blink/renderer/core/loader/frame_fetch_context.cc b/thi
 +  // TODO(mkwst): This only checks explicit IP addresses. We'll have to move
 +  // all this up to //net and //content in order to have any real impact on
 +  // gateway attacks. That turns out to be a TON of work (crbug.com/378566).
++  if (requestor_space == network::mojom::IPAddressSpace::kUnknown)
++    requestor_space = network::mojom::IPAddressSpace::kPublic;
 +  network::mojom::IPAddressSpace target_space =
 +      network::mojom::IPAddressSpace::kPublic;
 +  if (network_utils::IsReservedIPAddress(request_url.Host()))
@@ -56,7 +58,7 @@ diff --git a/third_party/blink/renderer/core/loader/frame_fetch_context.cc b/thi
 diff --git a/third_party/blink/renderer/core/loader/frame_fetch_context.h b/third_party/blink/renderer/core/loader/frame_fetch_context.h
 --- a/third_party/blink/renderer/core/loader/frame_fetch_context.h
 +++ b/third_party/blink/renderer/core/loader/frame_fetch_context.h
-@@ -165,6 +165,7 @@ class CORE_EXPORT FrameFetchContext final : public BaseFetchContext,
+@@ -179,6 +179,7 @@ class CORE_EXPORT FrameFetchContext final : public BaseFetchContext,
    bool ShouldBlockWebSocketByMixedContentCheck(const KURL&) const override;
    std::unique_ptr<WebSocketHandshakeThrottle> CreateWebSocketHandshakeThrottle()
        override;
@@ -75,7 +77,7 @@ diff --git a/third_party/blink/renderer/core/loader/worker_fetch_context.cc b/th
  #include "third_party/blink/renderer/platform/runtime_enabled_features.h"
  #include "third_party/blink/renderer/platform/supplementable.h"
  #include "third_party/blink/renderer/platform/weborigin/security_policy.h"
-@@ -90,6 +91,24 @@ bool WorkerFetchContext::ShouldBlockRequestByInspector(const KURL& url) const {
+@@ -90,6 +91,26 @@ bool WorkerFetchContext::ShouldBlockRequestByInspector(const KURL& url) const {
    return should_block_request;
  }
  
@@ -83,6 +85,8 @@ diff --git a/third_party/blink/renderer/core/loader/worker_fetch_context.cc b/th
 +  // TODO(mkwst): This only checks explicit IP addresses. We'll have to move
 +  // all this up to //net and //content in order to have any real impact on
 +  // gateway attacks. That turns out to be a TON of work (crbug.com/378566).
++  if (requestor_space == network::mojom::IPAddressSpace::kUnknown)
++    requestor_space = network::mojom::IPAddressSpace::kPublic;
 +  network::mojom::IPAddressSpace target_space =
 +      network::mojom::IPAddressSpace::kPublic;
 +  if (network_utils::IsReservedIPAddress(request_url.Host()))
@@ -114,7 +118,7 @@ diff --git a/third_party/blink/renderer/core/loader/worker_fetch_context.h b/thi
 diff --git a/third_party/blink/renderer/modules/background_fetch/background_fetch_manager.cc b/third_party/blink/renderer/modules/background_fetch/background_fetch_manager.cc
 --- a/third_party/blink/renderer/modules/background_fetch/background_fetch_manager.cc
 +++ b/third_party/blink/renderer/modules/background_fetch/background_fetch_manager.cc
-@@ -103,7 +103,6 @@ bool ShouldBlockDanglingMarkup(const KURL& request_url) {
+@@ -104,7 +104,6 @@ bool ShouldBlockDanglingMarkup(const KURL& request_url) {
  
  bool ShouldBlockGateWayAttacks(ExecutionContext* execution_context,
                                 const KURL& request_url) {
@@ -122,7 +126,7 @@ diff --git a/third_party/blink/renderer/modules/background_fetch/background_fetc
      network::mojom::IPAddressSpace requestor_space =
          execution_context->AddressSpace();
  
-@@ -120,7 +119,6 @@ bool ShouldBlockGateWayAttacks(ExecutionContext* execution_context,
+@@ -121,7 +120,6 @@ bool ShouldBlockGateWayAttacks(ExecutionContext* execution_context,
      bool is_external_request = requestor_space > target_space;
      if (is_external_request)
        return true;
@@ -188,16 +192,16 @@ diff --git a/third_party/blink/renderer/modules/websockets/websocket_common.cc b
 diff --git a/third_party/blink/renderer/modules/websockets/websocket_common.h b/third_party/blink/renderer/modules/websockets/websocket_common.h
 --- a/third_party/blink/renderer/modules/websockets/websocket_common.h
 +++ b/third_party/blink/renderer/modules/websockets/websocket_common.h
-@@ -8,6 +8,8 @@
+@@ -7,6 +7,8 @@
+ #ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_WEBSOCKETS_WEBSOCKET_COMMON_H_
  #define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBSOCKETS_WEBSOCKET_COMMON_H_
  
- #include "base/macros.h"
 +#include "services/network/public/mojom/ip_address_space.mojom.h"
 +#include "third_party/blink/renderer/platform/network/network_utils.h"
  #include "third_party/blink/renderer/modules/modules_export.h"
  #include "third_party/blink/renderer/platform/weborigin/kurl.h"
  #include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"
-@@ -51,6 +53,8 @@ class MODULES_EXPORT WebSocketCommon {
+@@ -54,6 +56,8 @@ class MODULES_EXPORT WebSocketCommon {
    void SetState(State state) { state_ = state; }
    const KURL& Url() const { return url_; }
  
@@ -206,6 +210,5 @@ diff --git a/third_party/blink/renderer/modules/websockets/websocket_common.h b/
    // The following methods are public for testing.
  
    // Returns true if |protocol| is a valid WebSocket subprotocol name.
--- 
-2.20.1
-
+--
+2.25.1

+ 34 - 34
build/patches/Block-qjz9zk-or-trk-requests.patch

@@ -7,26 +7,26 @@ This patch is based on Iridium's 'net: add "trk:" scheme and help identify URLs
 ---
  .../chrome_autocomplete_scheme_classifier.cc  |  1 +
  chrome/browser/history/history_utils.cc       |  1 +
- chrome/browser/ui/singleton_tabs.cc           |  3 +-
+ chrome/browser/ui/singleton_tabs.cc           |  5 ++++
  .../omnibox/browser/autocomplete_input.cc     |  8 ++++-
  components/url_formatter/url_fixer.cc         |  4 +++
  .../child_process_security_policy_impl.cc     |  1 +
  net/BUILD.gn                                  |  2 ++
- net/url_request/trk_protocol_handler.cc       | 25 +++++++++++++++
- net/url_request/trk_protocol_handler.h        | 31 +++++++++++++++++++
+ net/url_request/trk_protocol_handler.cc       | 25 ++++++++++++++++
+ net/url_request/trk_protocol_handler.h        | 30 +++++++++++++++++++
  net/url_request/url_request.cc                |  8 +++++
  .../url_request_context_builder.cc            |  3 ++
  url/url_constants.cc                          |  1 +
  url/url_constants.h                           |  1 +
  url/url_util.cc                               |  2 ++
- 14 files changed, 89 insertions(+), 2 deletions(-)
+ 14 files changed, 91 insertions(+), 1 deletion(-)
  create mode 100644 net/url_request/trk_protocol_handler.cc
  create mode 100644 net/url_request/trk_protocol_handler.h
 
 diff --git a/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc b/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc
 --- a/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc
 +++ b/chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.cc
-@@ -56,6 +56,7 @@ ChromeAutocompleteSchemeClassifier::GetInputTypeForScheme(
+@@ -57,6 +57,7 @@ ChromeAutocompleteSchemeClassifier::GetInputTypeForScheme(
    if (base::IsStringASCII(scheme) &&
        (ProfileIOData::IsHandledProtocol(scheme) ||
         base::LowerCaseEqualsASCII(scheme, content::kViewSourceScheme) ||
@@ -48,20 +48,22 @@ diff --git a/chrome/browser/history/history_utils.cc b/chrome/browser/history/hi
 diff --git a/chrome/browser/ui/singleton_tabs.cc b/chrome/browser/ui/singleton_tabs.cc
 --- a/chrome/browser/ui/singleton_tabs.cc
 +++ b/chrome/browser/ui/singleton_tabs.cc
-@@ -99,7 +99,8 @@ int GetIndexOfExistingTab(Browser* browser, const NavigateParams& params) {
- 
-     // Skip view-source tabs. This is needed because RewriteURLIfNecessary
-     // removes the "view-source:" scheme which leads to incorrect matching.
--    if (tab_url.SchemeIs(content::kViewSourceScheme))
-+    if (tab_url.SchemeIs(content::kViewSourceScheme) ||
-+        tab_url.SchemeIs(url::kTraceScheme))
+@@ -106,6 +106,11 @@ int GetIndexOfExistingTab(Browser* browser, const NavigateParams& params) {
        continue;
+     }
  
++    // trk: URLs must not be rewritten
++    if (tab_url.SchemeIs(url::kTraceScheme)) {
++      continue;
++    }
++
      GURL rewritten_tab_url = tab_url;
+     content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary(
+         &rewritten_tab_url, browser->profile());
 diff --git a/components/omnibox/browser/autocomplete_input.cc b/components/omnibox/browser/autocomplete_input.cc
 --- a/components/omnibox/browser/autocomplete_input.cc
 +++ b/components/omnibox/browser/autocomplete_input.cc
-@@ -81,10 +81,15 @@ void OffsetComponentsExcludingScheme(url::Parsed* parts, int offset) {
+@@ -90,10 +90,15 @@ void OffsetComponentsExcludingScheme(url::Parsed* parts, int offset) {
  bool HasScheme(const std::u16string& input, const char* scheme) {
    std::string utf8_input(base::UTF16ToUTF8(input));
    url::Component view_source_scheme;
@@ -77,7 +79,7 @@ diff --git a/components/omnibox/browser/autocomplete_input.cc b/components/omnib
    return url::FindAndCompareScheme(utf8_input, scheme, nullptr);
  }
  
-@@ -532,7 +537,8 @@ void AutocompleteInput::ParseForEmphasizeComponents(
+@@ -562,7 +567,8 @@ void AutocompleteInput::ParseForEmphasizeComponents(
    // For the view-source and blob schemes, we should emphasize the host of the
    // URL qualified by the view-source or blob prefix.
    if ((base::LowerCaseEqualsASCII(scheme_str, kViewSourceScheme) ||
@@ -104,18 +106,18 @@ diff --git a/components/url_formatter/url_fixer.cc b/components/url_formatter/ur
 diff --git a/content/browser/child_process_security_policy_impl.cc b/content/browser/child_process_security_policy_impl.cc
 --- a/content/browser/child_process_security_policy_impl.cc
 +++ b/content/browser/child_process_security_policy_impl.cc
-@@ -821,6 +821,7 @@ ChildProcessSecurityPolicyImpl::ChildProcessSecurityPolicyImpl()
- #endif  // BUILDFLAG(ENABLE_WEBSOCKETS)
-   RegisterWebSafeScheme(url::kFtpScheme);
-   RegisterWebSafeScheme(url::kDataScheme);
+@@ -745,6 +745,7 @@ ChildProcessSecurityPolicyImpl::ChildProcessSecurityPolicyImpl()
+   RegisterPseudoScheme(url::kJavaScriptScheme);
+   RegisterPseudoScheme(kViewSourceScheme);
+   RegisterPseudoScheme(kGoogleChromeScheme);
 +  RegisterWebSafeScheme(url::kTraceScheme);
-   RegisterWebSafeScheme("feed");
+ }
  
-   // TODO(nick): https://crbug.com/651534 blob: and filesystem: schemes embed
+ ChildProcessSecurityPolicyImpl::~ChildProcessSecurityPolicyImpl() {
 diff --git a/net/BUILD.gn b/net/BUILD.gn
 --- a/net/BUILD.gn
 +++ b/net/BUILD.gn
-@@ -1037,6 +1037,8 @@ component("net") {
+@@ -1039,6 +1039,8 @@ component("net") {
      "url_request/url_request_http_job.cc",
      "url_request/url_request_http_job.h",
      "url_request/url_request_interceptor.cc",
@@ -158,7 +160,7 @@ diff --git a/net/url_request/trk_protocol_handler.h b/net/url_request/trk_protoc
 new file mode 100644
 --- /dev/null
 +++ b/net/url_request/trk_protocol_handler.h
-@@ -0,0 +1,31 @@
+@@ -0,0 +1,30 @@
 +// Copyright (c) 2018 The ungoogled-chromium Authors. All rights reserved.
 +// Use of this source code is governed by a BSD-style license that can be
 +// found in the LICENSE file.
@@ -167,7 +169,6 @@ new file mode 100644
 +#define NET_URL_REQUEST_TRK_PROTOCOL_HANDLER_H_
 +
 +#include "base/compiler_specific.h"
-+#include "base/macros.h"
 +#include "net/base/net_export.h"
 +#include "net/url_request/url_request_job_factory.h"
 +
@@ -179,12 +180,12 @@ new file mode 100644
 +class NET_EXPORT TrkProtocolHandler
 +    : public URLRequestJobFactory::ProtocolHandler {
 + public:
++  TrkProtocolHandler(const TrkProtocolHandler&) = delete;
++  TrkProtocolHandler& operator=(const TrkProtocolHandler&) = delete;
++
 +  TrkProtocolHandler();
 +  std::unique_ptr<URLRequestJob> CreateJob(URLRequest* request) const override;
 +  bool IsSafeRedirectTarget(const GURL& location) const override;
-+
-+ private:
-+  DISALLOW_COPY_AND_ASSIGN(TrkProtocolHandler);
 +};
 +
 +}  // namespace net
@@ -209,7 +210,7 @@ diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc
  
  using base::Time;
  using std::string;
-@@ -584,6 +586,12 @@ URLRequest::URLRequest(const GURL& url,
+@@ -611,6 +613,12 @@ URLRequest::URLRequest(const GURL& url,
    // Sanity check out environment.
    DCHECK(base::ThreadTaskRunnerHandle::IsSet());
  
@@ -225,7 +226,7 @@ diff --git a/net/url_request/url_request.cc b/net/url_request/url_request.cc
 diff --git a/net/url_request/url_request_context_builder.cc b/net/url_request/url_request_context_builder.cc
 --- a/net/url_request/url_request_context_builder.cc
 +++ b/net/url_request/url_request_context_builder.cc
-@@ -46,6 +46,7 @@
+@@ -45,6 +45,7 @@
  #include "net/quic/quic_stream_factory.h"
  #include "net/ssl/ssl_config_service_defaults.h"
  #include "net/url_request/static_http_user_agent_settings.h"
@@ -233,7 +234,7 @@ diff --git a/net/url_request/url_request_context_builder.cc b/net/url_request/ur
  #include "net/url_request/url_request_context.h"
  #include "net/url_request/url_request_context_storage.h"
  #include "net/url_request/url_request_job_factory.h"
-@@ -544,6 +545,8 @@ std::unique_ptr<URLRequestContext> URLRequestContextBuilder::Build() {
+@@ -543,6 +544,8 @@ std::unique_ptr<URLRequestContext> URLRequestContextBuilder::Build() {
      job_factory->SetProtocolHandler(scheme_handler.first,
                                      std::move(scheme_handler.second));
    }
@@ -250,9 +251,9 @@ diff --git a/url/url_constants.cc b/url/url_constants.cc
  const char kTelScheme[] = "tel";
  const char kUrnScheme[] = "urn";
 +const char kTraceScheme[] = "trk";
+ const char kUuidInPackageScheme[] = "uuid-in-package";
  const char kWsScheme[] = "ws";
  const char kWssScheme[] = "wss";
- 
 diff --git a/url/url_constants.h b/url/url_constants.h
 --- a/url/url_constants.h
 +++ b/url/url_constants.h
@@ -261,9 +262,9 @@ diff --git a/url/url_constants.h b/url/url_constants.h
  COMPONENT_EXPORT(URL) extern const char kTelScheme[];
  COMPONENT_EXPORT(URL) extern const char kUrnScheme[];
 +COMPONENT_EXPORT(URL) extern const char kTraceScheme[];
+ COMPONENT_EXPORT(URL) extern const char kUuidInPackageScheme[];
  COMPONENT_EXPORT(URL) extern const char kWsScheme[];
  COMPONENT_EXPORT(URL) extern const char kWssScheme[];
- 
 diff --git a/url/url_util.cc b/url/url_util.cc
 --- a/url/url_util.cc
 +++ b/url/url_util.cc
@@ -283,6 +284,5 @@ diff --git a/url/url_util.cc b/url/url_util.cc
    };
  
    // Schemes that can be sent CORS requests.
--- 
-2.20.1
-
+--
+2.25.1

+ 54 - 107
build/patches/Bromite-AdBlockUpdaterService.patch

@@ -25,7 +25,6 @@ Fix RestoreForeignSessionTab by recreating the tab (issue #681)
  chrome/browser/browser_process_impl.cc        |  20 ++
  chrome/browser/browser_process_impl.h         |   2 +
  chrome/browser/chrome_browser_main.cc         |   2 +
- .../browser/chrome_content_browser_client.cc  |  15 -
  .../flags/android/cached_feature_flags.cc     |  11 +
  .../browser/flags/CachedFeatureFlags.java     |  10 +
  .../net/system_network_context_manager.cc     |   4 +
@@ -34,20 +33,19 @@ Fix RestoreForeignSessionTab by recreating the tab (issue #681)
  chrome/common/pref_names.cc                   |   3 +
  chrome/common/pref_names.h                    |   1 +
  components/component_updater/BUILD.gn         |   7 +
- .../adblock_updater_service.cc                | 272 ++++++++++++++++++
+ .../adblock_updater_service.cc                | 271 ++++++++++++++++++
  .../adblock_updater_service.h                 |  99 +++++++
  .../download_filters_task.cc                  | 224 +++++++++++++++
- .../component_updater/download_filters_task.h | 129 +++++++++
+ .../component_updater/download_filters_task.h | 130 +++++++++
  ...ent_subresource_filter_throttle_manager.cc |  11 +
  .../content/browser/ruleset_service.cc        |  33 ++-
  .../content/browser/ruleset_service.h         |   7 +-
  .../content/browser/ruleset_version.h         |   4 +
  .../browser/verified_ruleset_dealer.cc        |   4 +
  .../browser/subresource_filter_features.cc    | 113 +-------
- .../core/common/common_features.cc            |   2 +-
  .../core/common/indexed_ruleset.cc            |   5 +-
  .../navigation_throttle_runner.cc             |   5 -
- 38 files changed, 1158 insertions(+), 140 deletions(-)
+ 36 files changed, 1157 insertions(+), 124 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
@@ -60,7 +58,7 @@ Fix RestoreForeignSessionTab by recreating the tab (issue #681)
 diff --git a/chrome/android/chrome_java_resources.gni b/chrome/android/chrome_java_resources.gni
 --- a/chrome/android/chrome_java_resources.gni
 +++ b/chrome/android/chrome_java_resources.gni
-@@ -564,6 +564,7 @@ chrome_java_resources = [
+@@ -560,6 +560,7 @@ chrome_java_resources = [
    "java/res/layout/account_chooser_dialog_title.xml",
    "java/res/layout/account_divider_preference.xml",
    "java/res/layout/account_management_account_row.xml",
@@ -68,7 +66,7 @@ diff --git a/chrome/android/chrome_java_resources.gni b/chrome/android/chrome_ja
    "java/res/layout/auto_sign_in_first_run_dialog.xml",
    "java/res/layout/autofill_billing_address_dropdown.xml",
    "java/res/layout/autofill_card_unmask_prompt.xml",
-@@ -776,6 +777,7 @@ chrome_java_resources = [
+@@ -773,6 +774,7 @@ chrome_java_resources = [
    "java/res/xml/about_chrome_preferences.xml",
    "java/res/xml/accessibility_preferences.xml",
    "java/res/xml/account_management_preferences.xml",
@@ -79,9 +77,9 @@ diff --git a/chrome/android/chrome_java_resources.gni b/chrome/android/chrome_ja
 diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java_sources.gni
 --- a/chrome/android/chrome_java_sources.gni
 +++ b/chrome/android/chrome_java_sources.gni
-@@ -990,6 +990,8 @@ chrome_java_sources = [
-   "java/src/org/chromium/chrome/browser/payments/ui/ShoppingCart.java",
+@@ -978,6 +978,8 @@ chrome_java_sources = [
    "java/src/org/chromium/chrome/browser/permissions/PermissionSettingsBridge.java",
+   "java/src/org/chromium/chrome/browser/permissions/PermissionUpdateRequester.java",
    "java/src/org/chromium/chrome/browser/photo_picker/DecoderServiceImpl.java",
 +  "java/src/org/chromium/chrome/browser/settings/AdBlockEditor.java",
 +  "java/src/org/chromium/chrome/browser/settings/AdBlockPreferences.java",
@@ -163,7 +161,7 @@ new file mode 100644
 diff --git a/chrome/android/java/res/values/styles.xml b/chrome/android/java/res/values/styles.xml
 --- a/chrome/android/java/res/values/styles.xml
 +++ b/chrome/android/java/res/values/styles.xml
-@@ -199,6 +199,24 @@
+@@ -198,6 +198,24 @@
          </item>
      </style>
  
@@ -411,7 +409,7 @@ new file mode 100644
 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelImpl.java b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelImpl.java
 --- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelImpl.java
 +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelImpl.java
-@@ -801,7 +801,7 @@ public class TabModelImpl extends TabModelJniBridge {
+@@ -802,7 +802,7 @@ public class TabModelImpl extends TabModelJniBridge {
              Tab parent, Profile profile, WebContents webContents) {
          return getTabCreator(profile.isOffTheRecord())
                  .createTabWithWebContents(
@@ -423,7 +421,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabMod
 diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
 --- a/chrome/app/generated_resources.grd
 +++ b/chrome/app/generated_resources.grd
-@@ -10853,6 +10853,16 @@ Please help our engineers fix this problem. Tell us what happened right before y
+@@ -11157,6 +11157,16 @@ Please help our engineers fix this problem. Tell us what happened right before y
        Never show this again.
      </message>
  
@@ -443,16 +441,16 @@ diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources
 diff --git a/chrome/browser/after_startup_task_utils.cc b/chrome/browser/after_startup_task_utils.cc
 --- a/chrome/browser/after_startup_task_utils.cc
 +++ b/chrome/browser/after_startup_task_utils.cc
-@@ -26,6 +26,8 @@
- #include "ui/views/linux_ui/linux_ui.h"
- #endif
+@@ -33,6 +33,8 @@
+ #include "chromeos/lacros/lacros_service.h"
+ #endif  // BUILDFLAG(IS_CHROMEOS_LACROS)
  
 +#include "chrome/browser/browser_process.h"
 +
  using content::BrowserThread;
  
  namespace {
-@@ -121,6 +123,9 @@ void SetBrowserStartupIsComplete() {
+@@ -128,6 +130,9 @@ void SetBrowserStartupIsComplete() {
    g_after_startup_tasks.Get().clear();
    g_after_startup_tasks.Get().shrink_to_fit();
  
@@ -465,7 +463,7 @@ diff --git a/chrome/browser/after_startup_task_utils.cc b/chrome/browser/after_s
 diff --git a/chrome/browser/browser_process.h b/chrome/browser/browser_process.h
 --- a/chrome/browser/browser_process.h
 +++ b/chrome/browser/browser_process.h
-@@ -22,6 +22,7 @@
+@@ -21,6 +21,7 @@
  #include "build/chromeos_buildflags.h"
  #include "chrome/common/buildflags.h"
  #include "media/media_buildflags.h"
@@ -473,7 +471,7 @@ diff --git a/chrome/browser/browser_process.h b/chrome/browser/browser_process.h
  
  class BackgroundModeManager;
  class BrowserProcessPlatformPart;
-@@ -71,6 +72,10 @@ namespace component_updater {
+@@ -69,6 +70,10 @@ namespace component_updater {
  class ComponentUpdateService;
  }
  
@@ -484,7 +482,7 @@ diff --git a/chrome/browser/browser_process.h b/chrome/browser/browser_process.h
  namespace extensions {
  class EventRouterForwarder;
  }
-@@ -238,6 +243,7 @@ class BrowserProcess {
+@@ -237,6 +242,7 @@ class BrowserProcess {
  #endif
  
    virtual component_updater::ComponentUpdateService* component_updater() = 0;
@@ -495,7 +493,7 @@ diff --git a/chrome/browser/browser_process.h b/chrome/browser/browser_process.h
 diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
 --- a/chrome/browser/browser_process_impl.cc
 +++ b/chrome/browser/browser_process_impl.cc
-@@ -1070,6 +1070,26 @@ BrowserProcessImpl::component_updater() {
+@@ -1068,6 +1068,26 @@ BrowserProcessImpl::component_updater() {
    return component_updater_.get();
  }
  
@@ -525,7 +523,7 @@ diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_pro
 diff --git a/chrome/browser/browser_process_impl.h b/chrome/browser/browser_process_impl.h
 --- a/chrome/browser/browser_process_impl.h
 +++ b/chrome/browser/browser_process_impl.h
-@@ -200,6 +200,7 @@ class BrowserProcessImpl : public BrowserProcess,
+@@ -203,6 +203,7 @@ class BrowserProcessImpl : public BrowserProcess,
  #endif
  
    component_updater::ComponentUpdateService* component_updater() override;
@@ -533,7 +531,7 @@ diff --git a/chrome/browser/browser_process_impl.h b/chrome/browser/browser_proc
    MediaFileSystemRegistry* media_file_system_registry() override;
    WebRtcLogUploader* webrtc_log_uploader() override;
    network_time::NetworkTimeTracker* network_time_tracker() override;
-@@ -386,6 +387,7 @@ class BrowserProcessImpl : public BrowserProcess,
+@@ -385,6 +386,7 @@ class BrowserProcessImpl : public BrowserProcess,
    // to concerns over integrity of data shared between profiles,
    // but some users of component updater only install per-user.
    std::unique_ptr<component_updater::ComponentUpdateService> component_updater_;
@@ -544,54 +542,15 @@ diff --git a/chrome/browser/browser_process_impl.h b/chrome/browser/browser_proc
 diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
 --- a/chrome/browser/chrome_browser_main.cc
 +++ b/chrome/browser/chrome_browser_main.cc
-@@ -1649,6 +1649,8 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
-     speech::SodaInstaller::GetInstance()->Init(profile_->GetPrefs(),
-                                                browser_process_->local_state());
- #endif  // !defined(OS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
+@@ -1714,6 +1714,8 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
+     browser_process_->StartAutoupdateTimer();
+ #endif  // defined(OS_WIN) || (defined(OS_LINUX) ||
+         // BUILDFLAG(IS_CHROMEOS_LACROS))
 +    // force AdBlock updater initialisation
 +    g_browser_process->adblock_updater();
-   }
- 
- #if BUILDFLAG(IS_CHROMEOS_ASH)
-diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
---- a/chrome/browser/chrome_content_browser_client.cc
-+++ b/chrome/browser/chrome_content_browser_client.cc
-@@ -61,7 +61,6 @@
- #include "chrome/browser/hid/chrome_hid_delegate.h"
- #include "chrome/browser/interstitials/enterprise_util.h"
- #include "chrome/browser/lifetime/browser_shutdown.h"
--#include "chrome/browser/lookalikes/lookalike_url_navigation_throttle.h"
- #include "chrome/browser/media/audio_service_util.h"
- #include "chrome/browser/media/router/media_router_feature.h"
- #include "chrome/browser/media/webrtc/audio_debug_recordings_handler.h"
-@@ -3916,16 +3915,6 @@ ChromeContentBrowserClient::CreateThrottlesForNavigation(
-     content::NavigationHandle* handle) {
-   std::vector<std::unique_ptr<content::NavigationThrottle>> throttles;
- 
--  // MetricsNavigationThrottle requires that it runs before NavigationThrottles
--  // that may delay or cancel navigations, so only NavigationThrottles that
--  // don't delay or cancel navigations (e.g. throttles that are only observing
--  // callbacks without affecting navigation behavior) should be added before
--  // MetricsNavigationThrottle.
--  if (handle->IsInMainFrame()) {
--    throttles.push_back(
--        page_load_metrics::MetricsNavigationThrottle::Create(handle));
--  }
--
- #if BUILDFLAG(IS_CHROMEOS_ASH)
-   MaybeAddThrottle(
-       ash::WebTimeLimitNavigationThrottle::MaybeCreateThrottleFor(handle),
-@@ -4027,10 +4016,6 @@ ChromeContentBrowserClient::CreateThrottlesForNavigation(
-                    &throttles);
- #endif
  
--  MaybeAddThrottle(
--      LookalikeUrlNavigationThrottle::MaybeCreateNavigationThrottle(handle),
--      &throttles);
--
-   MaybeAddThrottle(PDFIFrameNavigationThrottle::MaybeCreateThrottleFor(handle),
-                    &throttles);
- #if BUILDFLAG(ENABLE_PDF)
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
 diff --git a/chrome/browser/flags/android/cached_feature_flags.cc b/chrome/browser/flags/android/cached_feature_flags.cc
 --- a/chrome/browser/flags/android/cached_feature_flags.cc
 +++ b/chrome/browser/flags/android/cached_feature_flags.cc
@@ -620,7 +579,7 @@ diff --git a/chrome/browser/flags/android/cached_feature_flags.cc b/chrome/brows
 diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java
 --- a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java
 +++ b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java
-@@ -264,6 +264,14 @@ public class CachedFeatureFlags {
+@@ -270,6 +270,14 @@ public class CachedFeatureFlags {
                  ChromeFeatureList.isEnabled(ChromeFeatureList.BACKGROUND_THREAD_POOL));
      }
  
@@ -635,7 +594,7 @@ diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/f
      /**
       * Caches flags that must take effect on startup but are set via native code.
       */
-@@ -469,5 +477,7 @@ public class CachedFeatureFlags {
+@@ -487,5 +495,7 @@ public class CachedFeatureFlags {
      @NativeMethods
      interface Natives {
          boolean isNetworkServiceWarmUpEnabled();
@@ -646,7 +605,7 @@ diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/f
 diff --git a/chrome/browser/net/system_network_context_manager.cc b/chrome/browser/net/system_network_context_manager.cc
 --- a/chrome/browser/net/system_network_context_manager.cc
 +++ b/chrome/browser/net/system_network_context_manager.cc
-@@ -348,6 +348,8 @@ SystemNetworkContextManager::SystemNetworkContextManager(
+@@ -343,6 +343,8 @@ SystemNetworkContextManager::SystemNetworkContextManager(
            SSLConfigServiceManager::CreateDefaultManager(local_state_)),
        proxy_config_monitor_(local_state_),
        stub_resolver_config_reader_(local_state_) {
@@ -655,7 +614,7 @@ diff --git a/chrome/browser/net/system_network_context_manager.cc b/chrome/brows
  #if !defined(OS_ANDROID)
    // QuicAllowed was not part of Android policy.
    const base::Value* value =
-@@ -418,6 +420,8 @@ SystemNetworkContextManager::~SystemNetworkContextManager() {
+@@ -413,6 +415,8 @@ SystemNetworkContextManager::~SystemNetworkContextManager() {
  void SystemNetworkContextManager::RegisterPrefs(PrefRegistrySimple* registry) {
    StubResolverConfigReader::RegisterPrefs(registry);
  
@@ -705,7 +664,7 @@ diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chro
 diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc
 --- a/chrome/common/pref_names.cc
 +++ b/chrome/common/pref_names.cc
-@@ -2194,6 +2194,9 @@ const char kAudioCaptureAllowed[] = "hardware.audio_capture_enabled";
+@@ -2252,6 +2252,9 @@ const char kAudioCaptureAllowed[] = "hardware.audio_capture_enabled";
  // capture devices without prompt.
  const char kAudioCaptureAllowedUrls[] = "hardware.audio_capture_allowed_urls";
  
@@ -742,8 +701,8 @@ diff --git a/components/component_updater/BUILD.gn b/components/component_update
      "component_updater_service.cc",
      "component_updater_service.h",
      "component_updater_service_internal.h",
-@@ -36,6 +42,7 @@ static_library("component_updater") {
-     "//components/crx_file",
+@@ -37,6 +43,7 @@ static_library("component_updater") {
+     "//components/prefs",
      "//components/update_client",
      "//components/version_info",
 +    "//services/network/public/mojom",
@@ -754,7 +713,7 @@ diff --git a/components/component_updater/adblock_updater_service.cc b/component
 new file mode 100644
 --- /dev/null
 +++ b/components/component_updater/adblock_updater_service.cc
-@@ -0,0 +1,272 @@
+@@ -0,0 +1,271 @@
 +/*
 +    This file is part of Bromite.
 +
@@ -785,7 +744,6 @@ new file mode 100644
 +#include "base/files/file_path.h"
 +#include "base/files/file_util.h"
 +#include "base/logging.h"
-+#include "base/macros.h"
 +#include "base/threading/thread_checker.h"
 +#include "base/threading/thread_task_runner_handle.h"
 +#include "base/time/time.h"
@@ -845,8 +803,8 @@ new file mode 100644
 +          << next_check_delay << " seconds. ";
 +
 +  scheduler_->Schedule(
-+      base::TimeDelta::FromSeconds(initial_check_delay),
-+      base::TimeDelta::FromSeconds(next_check_delay),
++      base::Seconds(initial_check_delay),
++      base::Seconds(next_check_delay),
 +      base::BindRepeating(&AdBlockUpdaterService::OnDemandScheduledUpdate,
 +                 base::Unretained(this)), base::DoNothing());
 +}
@@ -867,7 +825,7 @@ new file mode 100644
 +  if (!last_update_.is_null()) {
 +    base::TimeDelta delta =
 +        base::TimeTicks::Now() - last_update_;
-+    if (delta < base::TimeDelta::FromSeconds(on_demand_check_delay)) {
++    if (delta < base::Seconds(on_demand_check_delay)) {
 +      LOG(INFO) << "AdBlockUpdaterService: update not necessary.";
 +      return false;
 +    }
@@ -934,7 +892,7 @@ new file mode 100644
 +  if (!failed) {
 +    base::TimeDelta delta =
 +        base::Time::Now() - min_last_modified;
-+    if (delta < base::TimeDelta::FromSeconds(on_demand_check_delay)) {
++    if (delta < base::Seconds(on_demand_check_delay)) {
 +      LOG(INFO) << "AdBlockUpdaterService: update check not yet needed.";
 +      is_updating_ = false;
 +      return false;
@@ -1364,7 +1322,7 @@ diff --git a/components/component_updater/download_filters_task.h b/components/c
 new file mode 100644
 --- /dev/null
 +++ b/components/component_updater/download_filters_task.h
-@@ -0,0 +1,129 @@
+@@ -0,0 +1,130 @@
 +/*
 +    This file is part of Bromite.
 +
@@ -1389,7 +1347,6 @@ new file mode 100644
 +#include <vector>
 +
 +#include "base/callback.h"
-+#include "base/macros.h"
 +#include "base/memory/ref_counted.h"
 +#include "base/threading/thread_checker.h"
 +#include "components/update_client/network.h"
@@ -1439,6 +1396,9 @@ new file mode 100644
 +// Defines a specialized task for updating AdBlock filters.
 +class DownloadFiltersTask : public base::RefCounted<DownloadFiltersTask> {
 + public:
++  DownloadFiltersTask(const DownloadFiltersTask&) = delete;
++  DownloadFiltersTask& operator=(const DownloadFiltersTask&) = delete;
++
 +  using Callback =
 +      base::OnceCallback<void(scoped_refptr<DownloadFiltersTask> task, Error error)>;
 +
@@ -1488,7 +1448,6 @@ new file mode 100644
 +  base::FilePath file_path_;
 +
 +  friend class base::RefCounted<DownloadFiltersTask>;
-+  DISALLOW_COPY_AND_ASSIGN(DownloadFiltersTask);
 +};
 +
 +}  // namespace update_client
@@ -1497,7 +1456,7 @@ new file mode 100644
 diff --git a/components/subresource_filter/content/browser/content_subresource_filter_throttle_manager.cc b/components/subresource_filter/content/browser/content_subresource_filter_throttle_manager.cc
 --- a/components/subresource_filter/content/browser/content_subresource_filter_throttle_manager.cc
 +++ b/components/subresource_filter/content/browser/content_subresource_filter_throttle_manager.cc
-@@ -651,6 +651,17 @@ ContentSubresourceFilterThrottleManager::
+@@ -652,6 +652,17 @@ ContentSubresourceFilterThrottleManager::
        throttle->NotifyPageActivationWithRuleset(EnsureRulesetHandle(),
                                                  ad_tagging_state);
      }
@@ -1518,7 +1477,7 @@ diff --git a/components/subresource_filter/content/browser/content_subresource_f
 diff --git a/components/subresource_filter/content/browser/ruleset_service.cc b/components/subresource_filter/content/browser/ruleset_service.cc
 --- a/components/subresource_filter/content/browser/ruleset_service.cc
 +++ b/components/subresource_filter/content/browser/ruleset_service.cc
-@@ -47,9 +47,7 @@ namespace {
+@@ -46,9 +46,7 @@ namespace {
  
  void RecordIndexAndWriteRulesetResult(
      RulesetService::IndexAndWriteRulesetResult result) {
@@ -1633,7 +1592,7 @@ diff --git a/components/subresource_filter/content/browser/ruleset_service.cc b/
 diff --git a/components/subresource_filter/content/browser/ruleset_service.h b/components/subresource_filter/content/browser/ruleset_service.h
 --- a/components/subresource_filter/content/browser/ruleset_service.h
 +++ b/components/subresource_filter/content/browser/ruleset_service.h
-@@ -180,7 +180,7 @@ class RulesetService : public base::SupportsWeakPtr<RulesetService> {
+@@ -184,7 +184,7 @@ class RulesetService : public base::SupportsWeakPtr<RulesetService> {
    //
    // Virtual so that it can be mocked out in tests.
    virtual void IndexAndStoreAndPublishRulesetIfNeeded(
@@ -1642,7 +1601,7 @@ diff --git a/components/subresource_filter/content/browser/ruleset_service.h b/c
  
    // Get the ruleset version associated with the current local_state_.
    IndexedRulesetVersion GetMostRecentlyIndexedVersion() const;
-@@ -213,6 +213,11 @@ class RulesetService : public base::SupportsWeakPtr<RulesetService> {
+@@ -217,6 +217,11 @@ class RulesetService : public base::SupportsWeakPtr<RulesetService> {
        const base::FilePath& indexed_ruleset_base_dir,
        const UnindexedRulesetInfo& unindexed_ruleset_info);
  
@@ -1678,7 +1637,7 @@ diff --git a/components/subresource_filter/content/browser/verified_ruleset_deal
 +#include "base/logging.h"
  #include "base/metrics/histogram_macros.h"
  #include "base/notreached.h"
- #include "base/task_runner_util.h"
+ #include "base/task/task_runner_util.h"
 @@ -39,6 +40,9 @@ RulesetFilePtr VerifiedRulesetDealer::OpenAndSetRulesetFile(
    TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("loading"),
                 "VerifiedRulesetDealer::OpenAndSetRulesetFile", "file_valid",
@@ -1692,8 +1651,8 @@ diff --git a/components/subresource_filter/content/browser/verified_ruleset_deal
 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
-@@ -54,69 +54,7 @@ class CommaSeparatedStrings {
-   DISALLOW_COPY_AND_ASSIGN(CommaSeparatedStrings);
+@@ -55,69 +55,7 @@ class CommaSeparatedStrings {
+   const std::vector<base::StringPiece> pieces_;
  };
  
 -std::string TakeVariationParamOrReturnEmpty(
@@ -1763,7 +1722,7 @@ diff --git a/components/subresource_filter/core/browser/subresource_filter_featu
    // If ad tagging is enabled, turn on the dryrun automatically.
    bool ad_tagging_enabled = base::FeatureList::IsEnabled(kAdTagging);
    const struct {
-@@ -124,23 +62,16 @@ std::vector<Configuration> FillEnabledPresetConfigurations(
+@@ -125,23 +63,16 @@ std::vector<Configuration> FillEnabledPresetConfigurations(
      bool enabled_by_default;
      Configuration (*factory_method)();
    } kAvailablePresetConfigurations[] = {
@@ -1789,7 +1748,7 @@ diff --git a/components/subresource_filter/core/browser/subresource_filter_featu
        enabled_configurations.push_back(available_preset.factory_method());
      }
    }
-@@ -148,46 +79,10 @@ std::vector<Configuration> FillEnabledPresetConfigurations(
+@@ -149,46 +80,10 @@ std::vector<Configuration> FillEnabledPresetConfigurations(
    return enabled_configurations;
  }
  
@@ -1837,17 +1796,6 @@ diff --git a/components/subresource_filter/core/browser/subresource_filter_featu
  
    return configs;
  }
-diff --git a/components/subresource_filter/core/common/common_features.cc b/components/subresource_filter/core/common/common_features.cc
---- a/components/subresource_filter/core/common/common_features.cc
-+++ b/components/subresource_filter/core/common/common_features.cc
-@@ -6,6 +6,6 @@
- 
- namespace subresource_filter {
- 
--const base::Feature kAdTagging{"AdTagging", base::FEATURE_ENABLED_BY_DEFAULT};
-+const base::Feature kAdTagging{"AdTagging", base::FEATURE_DISABLED_BY_DEFAULT};
- 
- }  // namespace subresource_filter
 diff --git a/components/subresource_filter/core/common/indexed_ruleset.cc b/components/subresource_filter/core/common/indexed_ruleset.cc
 --- a/components/subresource_filter/core/common/indexed_ruleset.cc
 +++ b/components/subresource_filter/core/common/indexed_ruleset.cc
@@ -1874,7 +1822,7 @@ diff --git a/components/subresource_filter/core/common/indexed_ruleset.cc b/comp
 diff --git a/content/browser/renderer_host/navigation_throttle_runner.cc b/content/browser/renderer_host/navigation_throttle_runner.cc
 --- a/content/browser/renderer_host/navigation_throttle_runner.cc
 +++ b/content/browser/renderer_host/navigation_throttle_runner.cc
-@@ -180,11 +180,6 @@ void NavigationThrottleRunner::RegisterNavigationThrottles() {
+@@ -184,11 +184,6 @@ void NavigationThrottleRunner::RegisterNavigationThrottles() {
    // than other throttles that might care about those navigations, e.g.
    // throttles handling pages with 407 errors that require extra authentication.
    AddThrottle(HttpErrorNavigationThrottle::MaybeCreateThrottleFor(*request));
@@ -1886,6 +1834,5 @@ diff --git a/content/browser/renderer_host/navigation_throttle_runner.cc b/conte
  }
  
  NavigationThrottle* NavigationThrottleRunner::GetDeferringThrottle() const {
--- 
-2.20.1
-
+--
+2.25.1

+ 579 - 105
build/patches/Bromite-auto-updater.patch

@@ -6,26 +6,30 @@ Enable checking for new versions, with notifications and proxy support
 ---
  .../java/templates/BuildConfig.template       |   2 +
  build/config/android/rules.gni                |   3 +
- chrome/android/chrome_java_sources.gni        |   1 +
+ chrome/android/chrome_java_sources.gni        |   3 +
  .../java/res/xml/about_chrome_preferences.xml |   5 +
  .../about_settings/AboutChromeSettings.java   |  28 ++-
  .../chrome/browser/omaha/OmahaBase.java       |  47 +++-
- .../chrome/browser/omaha/UpdateConfigs.java   |   6 +-
- .../browser/omaha/UpdateStatusProvider.java   |  33 ++-
+ .../chrome/browser/omaha/UpdateConfigs.java   |  30 ++-
+ .../browser/omaha/UpdateMenuItemHelper.java   |  69 +++++-
+ .../browser/omaha/UpdateStatusProvider.java   | 169 ++++++++++++---
  .../browser/omaha/VersionNumberGetter.java    |   3 +-
  .../inline/BromiteInlineUpdateController.java | 204 ++++++++++++++++++
- .../inline/InlineUpdateControllerFactory.java |   8 +-
+ .../omaha/inline/InlineUpdateController.java  |  45 ++++
+ .../inline/InlineUpdateControllerFactory.java |  21 ++
  chrome/browser/endpoint_fetcher/BUILD.gn      |   2 +
  .../endpoint_fetcher/endpoint_fetcher.cc      | 129 +++++++++++
  .../endpoint_fetcher/endpoint_fetcher.h       |  23 +-
  .../endpoint_fetcher/EndpointFetcher.java     |  11 +
  .../EndpointHeaderResponse.java               |  31 +++
- chrome/browser/flag-metadata.json             |   2 +-
- chrome/browser/flag_descriptions.cc           |   5 +-
- .../flags/android/chrome_feature_list.cc      |   2 +-
- .../strings/android_chrome_strings.grd        |   8 +-
- 20 files changed, 516 insertions(+), 37 deletions(-)
+ .../flags/android/chrome_feature_list.cc      |   6 +-
+ .../flags/android/chrome_feature_list.h       |   1 +
+ .../browser/flags/ChromeFeatureList.java      |   1 +
+ .../strings/android_chrome_strings.grd        |  20 +-
+ 22 files changed, 811 insertions(+), 42 deletions(-)
  create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/omaha/inline/BromiteInlineUpdateController.java
+ create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/omaha/inline/InlineUpdateController.java
+ create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/omaha/inline/InlineUpdateControllerFactory.java
  create mode 100644 chrome/browser/endpoint_fetcher/java/src/org/chromium/chrome/browser/endpoint_fetcher/EndpointHeaderResponse.java
 
 diff --git a/build/android/java/templates/BuildConfig.template b/build/android/java/templates/BuildConfig.template
@@ -41,7 +45,7 @@ diff --git a/build/android/java/templates/BuildConfig.template b/build/android/j
 diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni
 --- a/build/config/android/rules.gni
 +++ b/build/config/android/rules.gni
-@@ -1967,6 +1967,9 @@ if (enable_java_templates) {
+@@ -1975,6 +1975,9 @@ if (enable_java_templates) {
            ]
          }
        }
@@ -54,12 +58,14 @@ diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni
 diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java_sources.gni
 --- a/chrome/android/chrome_java_sources.gni
 +++ b/chrome/android/chrome_java_sources.gni
-@@ -886,6 +886,7 @@ chrome_java_sources = [
-   "java/src/org/chromium/chrome/browser/omaha/inline/InlineUpdateController.java",
-   "java/src/org/chromium/chrome/browser/omaha/inline/InlineUpdateControllerFactory.java",
-   "java/src/org/chromium/chrome/browser/omaha/inline/NoopInlineUpdateController.java",
+@@ -882,6 +882,9 @@ chrome_java_sources = [
+   "java/src/org/chromium/chrome/browser/omaha/UpdateConfigs.java",
+   "java/src/org/chromium/chrome/browser/omaha/UpdateMenuItemHelper.java",
+   "java/src/org/chromium/chrome/browser/omaha/UpdateStatusProvider.java",
++  "java/src/org/chromium/chrome/browser/omaha/inline/InlineUpdateController.java",
++  "java/src/org/chromium/chrome/browser/omaha/inline/InlineUpdateControllerFactory.java",
 +  "java/src/org/chromium/chrome/browser/omaha/inline/BromiteInlineUpdateController.java",
-   "java/src/org/chromium/chrome/browser/omaha/inline/PlayInlineUpdateController.java",
+   "java/src/org/chromium/chrome/browser/omaha/VersionNumberGetter.java",
    "java/src/org/chromium/chrome/browser/omaha/metrics/HistogramUtils.java",
    "java/src/org/chromium/chrome/browser/omaha/metrics/TrackingProvider.java",
 diff --git a/chrome/android/java/res/xml/about_chrome_preferences.xml b/chrome/android/java/res/xml/about_chrome_preferences.xml
@@ -213,35 +219,208 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omaha/OmahaBase
 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateConfigs.java b/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateConfigs.java
 --- a/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateConfigs.java
 +++ b/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateConfigs.java
-@@ -65,7 +65,7 @@ public class UpdateConfigs {
-     private static final String UPDATE_NOTIFICATION_EXPERIMENTAL_PARAM_NAME =
-             "update_notification_experimental_context";
+@@ -11,6 +11,7 @@ import androidx.annotation.IntDef;
+ import androidx.annotation.Nullable;
+ 
+ import org.chromium.base.CommandLine;
++import org.chromium.chrome.browser.flags.ChromeFeatureList;
+ import org.chromium.chrome.browser.flags.ChromeSwitches;
+ import org.chromium.chrome.browser.omaha.UpdateStatusProvider.UpdateState;
+ import org.chromium.components.variations.VariationsAssociatedData;
+@@ -37,10 +38,12 @@ public class UpdateConfigs {
+     private static final String UPDATE_AVAILABLE_SWITCH_VALUE = "update_available";
+     private static final String UNSUPPORTED_OS_VERSION_SWITCH_VALUE = "unsupported_os_version";
  
--    private static final long DEFAULT_UPDATE_NOTIFICATION_INTERVAL = 21 * DateUtils.DAY_IN_MILLIS;
 +    private static final long DEFAULT_UPDATE_NOTIFICATION_INTERVAL = 3 * DateUtils.DAY_IN_MILLIS;
      private static final long DEFAULT_UPDATE_ATTRIBUTION_WINDOW_MS = 2 * DateUtils.DAY_IN_MILLIS;
  
      /** Possible update flow configurations. */
-@@ -300,7 +300,7 @@ public class UpdateConfigs {
-      * @return the current inline update flow configuration.
-      */
-     @UpdateFlowConfiguration
--    static int getConfiguration() {
-+    public static int getConfiguration() {
-         if (!ChromeFeatureList.isEnabled(ChromeFeatureList.INLINE_UPDATE_FLOW)) {
-             // Always use the the old flow if the inline update flow feature is not enabled.
-             return UpdateFlowConfiguration.INTENT_ONLY;
-@@ -328,4 +328,4 @@ public class UpdateConfigs {
-         if (configuration == null) return "";
-         return configuration.toLowerCase(Locale.US);
+-    @IntDef({UpdateFlowConfiguration.NEVER_SHOW, UpdateFlowConfiguration.INTENT_ONLY})
++    @IntDef({UpdateFlowConfiguration.NEVER_SHOW, UpdateFlowConfiguration.INTENT_ONLY,
++            UpdateFlowConfiguration.INLINE_ONLY})
+     @Retention(RetentionPolicy.SOURCE)
+     public @interface UpdateFlowConfiguration {
+         /** Turns off all update indicators. */
+@@ -50,6 +53,12 @@ public class UpdateConfigs {
+          * Requires Omaha to say an update is available, and only ever Intents out to Play Store.
+          */
+         int INTENT_ONLY = 2;
++
++        /**
++         * Requires both Omaha and Play Store to say an update is available. Only ever uses the
++         * inline update flow.
++         */
++        int INLINE_ONLY = 3;
+     }
+ 
+     /**
+@@ -124,6 +133,13 @@ public class UpdateConfigs {
+         return DEFAULT_UPDATE_ATTRIBUTION_WINDOW_MS;
+     }
+ 
++    /**
++     * @return A time interval for scheduling update notification. Unit: mills.
++     */
++    public static long getUpdateNotificationInterval() {
++        return DEFAULT_UPDATE_NOTIFICATION_INTERVAL;
++    }
++
+     /**
+      * Gets a String VariationsAssociatedData parameter. Also checks for a command-line switch
+      * with the same name, for easy local testing.
+@@ -139,4 +155,14 @@ public class UpdateConfigs {
+         }
+         return value;
      }
 -}
 \ No newline at end of file
++
++    @UpdateFlowConfiguration
++    public static int getConfiguration() {
++        if (!ChromeFeatureList.isEnabled(ChromeFeatureList.INLINE_UPDATE_FLOW)) {
++            // Always use the the old flow if the inline update flow feature is not enabled.
++            return UpdateFlowConfiguration.INLINE_ONLY;
++        }
++
++        return UpdateFlowConfiguration.NEVER_SHOW;
++    }
 +}
+diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateMenuItemHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateMenuItemHelper.java
+--- a/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateMenuItemHelper.java
++++ b/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateMenuItemHelper.java
+@@ -22,6 +22,7 @@ import org.chromium.base.metrics.RecordHistogram;
+ import org.chromium.base.task.PostTask;
+ import org.chromium.base.task.TaskTraits;
+ import org.chromium.chrome.R;
++import org.chromium.chrome.browser.omaha.UpdateStatusProvider.UpdateInteractionSource;
+ import org.chromium.chrome.browser.omaha.UpdateStatusProvider.UpdateState;
+ import org.chromium.chrome.browser.omaha.UpdateStatusProvider.UpdateStatus;
+ import org.chromium.chrome.browser.preferences.Pref;
+@@ -157,7 +158,7 @@ public class UpdateMenuItemHelper {
+ 
+                 try {
+                     UpdateStatusProvider.getInstance().startIntentUpdate(
+-                            activity, false /* newTask */);
++                            activity, UpdateInteractionSource.FROM_MENU, false /* newTask */);
+                     recordItemClickedHistogram(ITEM_CLICKED_INTENT_LAUNCHED);
+                     getPrefService().setBoolean(Pref.CLICKED_UPDATE_MENU_ITEM, true);
+                 } catch (ActivityNotFoundException e) {
+@@ -165,8 +166,22 @@ public class UpdateMenuItemHelper {
+                     recordItemClickedHistogram(ITEM_CLICKED_INTENT_FAILED);
+                 }
+                 break;
++            case UpdateState.INLINE_UPDATE_AVAILABLE:
++                UpdateStatusProvider.getInstance().startInlineUpdate(
++                        UpdateInteractionSource.FROM_MENU, activity);
++                break;
++            case UpdateState.INLINE_UPDATE_READY:
++                UpdateStatusProvider.getInstance().finishInlineUpdate(
++                        UpdateInteractionSource.FROM_MENU);
++                break;
++            case UpdateState.INLINE_UPDATE_FAILED:
++                UpdateStatusProvider.getInstance().retryInlineUpdate(
++                        UpdateInteractionSource.FROM_MENU, activity);
++                break;
+             case UpdateState.UNSUPPORTED_OS_VERSION:
+             // Intentional fall through.
++            case UpdateState.INLINE_UPDATE_DOWNLOADING:
++            // Intentional fall through.
+             default:
+                 return;
+         }
+@@ -268,6 +283,58 @@ public class UpdateMenuItemHelper {
+                 mMenuUiState.itemState.icon = R.drawable.ic_error_24dp_filled;
+                 mMenuUiState.itemState.enabled = false;
+                 break;
++            case UpdateState.INLINE_UPDATE_AVAILABLE:
++                // The badge is hidden if the update menu item has been clicked until there is an
++                // even newer version of Chrome available.
++                showBadge |= !TextUtils.equals(
++                        getPrefService().getString(
++                                Pref.LATEST_VERSION_WHEN_CLICKED_UPDATE_MENU_ITEM),
++                        mStatus.latestUnsupportedVersion);
++
++                if (showBadge) {
++                    mMenuUiState.buttonState = new MenuButtonState();
++                    mMenuUiState.buttonState.menuContentDescription =
++                            R.string.accessibility_toolbar_btn_menu_update;
++                    mMenuUiState.buttonState.darkBadgeIcon = R.drawable.badge_update_dark;
++                    mMenuUiState.buttonState.lightBadgeIcon = R.drawable.badge_update_light;
++                }
++
++                mMenuUiState.itemState = new MenuItemState();
++                mMenuUiState.itemState.title = R.string.menu_update;
++                mMenuUiState.itemState.titleColorId = R.color.default_text_color_blue;
++                mMenuUiState.itemState.summary = UpdateConfigs.getCustomSummary();
++                if (TextUtils.isEmpty(mMenuUiState.itemState.summary)) {
++                    mMenuUiState.itemState.summary =
++                            resources.getString(R.string.menu_update_summary_default);
++                }
++                mMenuUiState.itemState.icon = R.drawable.ic_history_googblue_24dp;
++                mMenuUiState.itemState.iconTintId = R.color.default_icon_color_blue_light;
++                mMenuUiState.itemState.enabled = true;
++                break;
++            case UpdateState.INLINE_UPDATE_DOWNLOADING:
++                mMenuUiState.itemState = new MenuItemState();
++                mMenuUiState.itemState.title = R.string.menu_inline_update_downloading;
++                mMenuUiState.itemState.titleColorId = R.color.default_text_color_secondary;
++                break;
++            case UpdateState.INLINE_UPDATE_READY:
++                mMenuUiState.itemState = new MenuItemState();
++                mMenuUiState.itemState.title = R.string.menu_inline_update_ready;
++                mMenuUiState.itemState.titleColorId = R.color.default_text_color_blue;
++                mMenuUiState.itemState.summary =
++                        resources.getString(R.string.menu_inline_update_ready_summary);
++                mMenuUiState.itemState.icon = R.drawable.infobar_chrome;
++                mMenuUiState.itemState.iconTintId = R.color.default_icon_color_blue_light;
++                mMenuUiState.itemState.enabled = true;
++                break;
++            case UpdateState.INLINE_UPDATE_FAILED:
++                mMenuUiState.itemState = new MenuItemState();
++                mMenuUiState.itemState.title = R.string.menu_inline_update_failed;
++                mMenuUiState.itemState.titleColorId = R.color.default_text_color_blue;
++                mMenuUiState.itemState.summary = resources.getString(R.string.try_again);
++                mMenuUiState.itemState.icon = R.drawable.ic_history_googblue_24dp;
++                mMenuUiState.itemState.iconTintId = R.color.default_icon_color_blue_light;
++                mMenuUiState.itemState.enabled = true;
++                break;
+             case UpdateState.NONE:
+             // Intentional fall through.
+             default:
 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateStatusProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateStatusProvider.java
 --- a/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateStatusProvider.java
 +++ b/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateStatusProvider.java
-@@ -45,6 +45,12 @@ import java.io.File;
+@@ -4,6 +4,7 @@
+ 
+ package org.chromium.chrome.browser.omaha;
+ 
++import android.app.Activity;
+ import android.content.ActivityNotFoundException;
+ import android.content.Context;
+ import android.content.Intent;
+@@ -16,7 +17,11 @@ import android.text.TextUtils;
+ import androidx.annotation.IntDef;
+ import androidx.annotation.NonNull;
+ import androidx.annotation.Nullable;
++import androidx.annotation.VisibleForTesting;
+ 
++import org.chromium.base.ActivityState;
++import org.chromium.base.ApplicationStatus;
++import org.chromium.base.ApplicationStatus.ActivityStateListener;
+ import org.chromium.base.BuildInfo;
+ import org.chromium.base.Callback;
+ import org.chromium.base.ContextUtils;
+@@ -26,6 +31,9 @@ import org.chromium.base.metrics.RecordHistogram;
+ import org.chromium.base.task.AsyncTask;
+ import org.chromium.base.task.AsyncTask.Status;
+ import org.chromium.base.task.PostTask;
++import org.chromium.chrome.browser.app.ChromeActivity;
++import org.chromium.chrome.browser.omaha.inline.InlineUpdateController;
++import org.chromium.chrome.browser.omaha.inline.InlineUpdateControllerFactory;
+ import org.chromium.chrome.browser.omaha.metrics.UpdateSuccessMetrics;
+ import org.chromium.chrome.browser.preferences.ChromePreferenceKeys;
+ import org.chromium.chrome.browser.preferences.SharedPreferencesManager;
+@@ -36,28 +44,50 @@ import java.io.File;
  import java.lang.annotation.Retention;
  import java.lang.annotation.RetentionPolicy;
  
@@ -254,17 +433,230 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omaha/UpdateSta
  /**
   * Provides the current update state for Chrome.  This update state is asynchronously determined and
   * can change as Chrome runs.
-@@ -339,8 +345,7 @@ public class UpdateStatusProvider implements ActivityStateListener {
-             case UpdateConfigs.UpdateFlowConfiguration.NEVER_SHOW:
-                 return UpdateState.NONE;
-             case UpdateConfigs.UpdateFlowConfiguration.INLINE_ONLY:
--                if (omahaState != UpdateState.UPDATE_AVAILABLE) return omahaState;
--                if (inlineState == UpdateState.NONE) return UpdateState.NONE;
+  *
+  * For manually testing this functionality, see {@link UpdateConfigs}.
+  */
+-public class UpdateStatusProvider {
++public class UpdateStatusProvider implements ActivityStateListener {
++    /**
++     * Possible sources of user interaction regarding updates.
++     * Treat this as append only as it is used by UMA.
++     */
++    @IntDef({UpdateInteractionSource.FROM_MENU, UpdateInteractionSource.FROM_INFOBAR,
++            UpdateInteractionSource.FROM_NOTIFICATION})
++    @Retention(RetentionPolicy.SOURCE)
++    public @interface UpdateInteractionSource {
++        int FROM_MENU = 0;
++        int FROM_INFOBAR = 1;
++        int FROM_NOTIFICATION = 2;
++
++        int NUM_ENTRIES = 3;
++    }
++
+     /**
+      * Possible update states.
+      * Treat this as append only as it is used by UMA.
+      */
+-    @IntDef({UpdateState.NONE, UpdateState.UPDATE_AVAILABLE, UpdateState.UNSUPPORTED_OS_VERSION})
++    @IntDef({UpdateState.NONE, UpdateState.UPDATE_AVAILABLE, UpdateState.UNSUPPORTED_OS_VERSION,
++            UpdateState.INLINE_UPDATE_AVAILABLE, UpdateState.INLINE_UPDATE_DOWNLOADING,
++            UpdateState.INLINE_UPDATE_READY, UpdateState.INLINE_UPDATE_FAILED})
+     @Retention(RetentionPolicy.SOURCE)
+     public @interface UpdateState {
+         int NONE = 0;
+         int UPDATE_AVAILABLE = 1;
+         int UNSUPPORTED_OS_VERSION = 2;
+-        // Inline updates are deprecated.
+-        // int INLINE_UPDATE_AVAILABLE = 3;
+-        // int INLINE_UPDATE_DOWNLOADING = 4;
+-        // int INLINE_UPDATE_READY = 5;
+-        // int INLINE_UPDATE_FAILED = 6;
++        int INLINE_UPDATE_AVAILABLE = 3;
++        int INLINE_UPDATE_DOWNLOADING = 4;
++        int INLINE_UPDATE_READY = 5;
++        int INLINE_UPDATE_FAILED = 6;
+ 
+         int NUM_ENTRIES = 7;
+     }
+@@ -93,6 +123,12 @@ public class UpdateStatusProvider {
+          */
+         private boolean mIsSimulated;
+ 
++        /**
++         * Whether or not we are currently trying to simulate an inline flow.  Used to allow
++         * overriding Omaha update state, which usually supersedes inline update states.
++         */
++        private boolean mIsInlineSimulated;
++
+         public UpdateStatus() {}
+ 
+         UpdateStatus(UpdateStatus other) {
+@@ -101,11 +137,13 @@ public class UpdateStatusProvider {
+             latestVersion = other.latestVersion;
+             latestUnsupportedVersion = other.latestUnsupportedVersion;
+             mIsSimulated = other.mIsSimulated;
++            mIsInlineSimulated = other.mIsInlineSimulated;
+         }
+     }
+ 
+     private final ObserverList<Callback<UpdateStatus>> mObservers = new ObserverList<>();
+ 
++    private final InlineUpdateController mInlineController;
+     private final UpdateQuery mOmahaQuery;
+     private final UpdateSuccessMetrics mMetrics;
+     private @Nullable UpdateStatus mStatus;
+@@ -173,19 +211,44 @@ public class UpdateStatusProvider {
+         pingObservers();
+     }
+ 
++    /**
++     * Starts the inline update process, if possible.
++     * @source         The source of the action (the UI that caused it).
++     * @param activity An {@link Activity} that will be used to interact with Play.
++     */
++    public void startInlineUpdate(@UpdateInteractionSource int source, Activity activity) {
++        if (mStatus == null || mStatus.updateState != UpdateState.INLINE_UPDATE_AVAILABLE) return;
++        mInlineController.startUpdate(activity);
++    }
++
++    /**
++     * Retries the inline update process, if possible.
++     * @param activity An {@link Activity} that will be used to interact with Play.
++     */
++    public void retryInlineUpdate(@UpdateInteractionSource int source, Activity activity) {
++        if (mStatus == null || mStatus.updateState != UpdateState.INLINE_UPDATE_AVAILABLE) return;
++        mInlineController.startUpdate(activity);
++    }
++
++    /** Finishes the inline update process, which may involve restarting the app. */
++    public void finishInlineUpdate(@UpdateInteractionSource int source) {
++        if (mStatus == null || mStatus.updateState != UpdateState.INLINE_UPDATE_READY) return;
++        mInlineController.completeUpdate();
++    }
++
+     /**
+      * Starts the intent update process, if possible
+      * @param context An {@link Context} that will be used to fire off the update intent.
++     * @param source  The source of the action (the UI that caused it).
+      * @param newTask Whether or not to make the intent a new task.
+      * @return        Whether or not the update intent was sent and had a valid handler.
+      */
+-    public boolean startIntentUpdate(Context context, boolean newTask) {
++    public boolean startIntentUpdate(
++            Context context, @UpdateInteractionSource int source, boolean newTask) {
+         if (mStatus == null || mStatus.updateState != UpdateState.UPDATE_AVAILABLE) return false;
+         if (TextUtils.isEmpty(mStatus.updateUrl)) return false;
+ 
+         try {
+-            mMetrics.startUpdate();
+-
+             Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(mStatus.updateUrl));
+             if (newTask) intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+             context.startActivity(intent);
+@@ -196,9 +259,29 @@ public class UpdateStatusProvider {
+         return true;
+     }
+ 
++    // ApplicationStateListener implementation.
++    @Override
++    public void onActivityStateChange(Activity changedActivity, @ActivityState int newState) {
++        boolean hasActiveActivity = false;
++
++        for (Activity activity : ApplicationStatus.getRunningActivities()) {
++            if (activity == null || !(activity instanceof ChromeActivity)) continue;
++
++            hasActiveActivity |=
++                    ApplicationStatus.getStateForActivity(activity) == ActivityState.RESUMED;
++            if (hasActiveActivity) break;
++        }
++
++        mInlineController.setEnabled(hasActiveActivity);
++    }
++
+     private UpdateStatusProvider() {
++        mInlineController = InlineUpdateControllerFactory.create(this::resolveStatus);
+         mOmahaQuery = new UpdateQuery(this::resolveStatus);
+         mMetrics = new UpdateSuccessMetrics();
++
++        // Note that as a singleton this class never unregisters.
++        ApplicationStatus.registerStateListenerForAllActivities(this);
+     }
+ 
+     private void pingObservers() {
+@@ -206,27 +289,59 @@ public class UpdateStatusProvider {
+     }
+ 
+     private void resolveStatus() {
+-        if (mOmahaQuery.getStatus() != Status.FINISHED) {
++        if (mOmahaQuery.getStatus() != Status.FINISHED || mInlineController.getStatus() == null) {
+             return;
+         }
+ 
+         // We pull the Omaha result once as it will never change.
+         if (mStatus == null) mStatus = new UpdateStatus(mOmahaQuery.getResult());
+ 
+-        if (!mStatus.mIsSimulated) {
+-            mStatus.updateState = mOmahaQuery.getResult().updateState;
++        if (mStatus.mIsSimulated) {
++            if (mStatus.mIsInlineSimulated) {
++                @UpdateState
++                int inlineState = mInlineController.getStatus();
++
++                if (inlineState == UpdateState.NONE) {
++                    mStatus.updateState = mOmahaQuery.getResult().updateState;
++                } else {
++                    mStatus.updateState = inlineState;
++                }
++            }
++        } else {
++            @UpdateState
++            int omahaState = mOmahaQuery.getResult().updateState;
++            @UpdateState
++            int inlineState = mInlineController.getStatus();
++            mStatus.updateState = resolveOmahaAndInlineStatus(
++                    UpdateConfigs.getConfiguration(), omahaState, inlineState);
+         }
+ 
+         if (!mRecordedInitialStatus) {
+             RecordHistogram.recordEnumeratedHistogram(
+                     "GoogleUpdate.StartUp.State", mStatus.updateState, UpdateState.NUM_ENTRIES);
+-            mMetrics.analyzeFirstStatus();
+             mRecordedInitialStatus = true;
+         }
+ 
+         pingObservers();
+     }
+ 
++    @VisibleForTesting
++    static @UpdateState int resolveOmahaAndInlineStatus(
++            @UpdateConfigs.UpdateFlowConfiguration int configuration, @UpdateState int omahaState,
++            @UpdateState int inlineState) {
++        switch (configuration) {
++            case UpdateConfigs.UpdateFlowConfiguration.NEVER_SHOW:
++                return UpdateState.NONE;
++            case UpdateConfigs.UpdateFlowConfiguration.INLINE_ONLY:
 +                if (inlineState == UpdateState.NONE) return omahaState;
-                 return inlineState;
-             case UpdateConfigs.UpdateFlowConfiguration.BEST_EFFORT:
-                 if (omahaState != UpdateState.UPDATE_AVAILABLE) return omahaState;
-@@ -415,24 +420,12 @@ public class UpdateStatusProvider implements ActivityStateListener {
++                return inlineState;
++            case UpdateConfigs.UpdateFlowConfiguration.INTENT_ONLY: // Intentional fall through.
++            default:
++                // Fall back to use Omaha only and use the old flow.
++                return omahaState;
++        }
++    }
++
+     private static final class LazyHolder {
+         private static final UpdateStatusProvider INSTANCE = new UpdateStatusProvider();
+     }
+@@ -268,6 +383,8 @@ public class UpdateStatusProvider {
+             status.mIsSimulated = true;
+             status.updateState = forcedUpdateState;
+ 
++            status.mIsInlineSimulated = forcedUpdateState == UpdateState.INLINE_UPDATE_AVAILABLE;
++
+             // Push custom configurations for certain update states.
+             switch (forcedUpdateState) {
+                 case UpdateState.UPDATE_AVAILABLE:
+@@ -287,24 +404,12 @@ public class UpdateStatusProvider {
          private UpdateStatus getRealStatus(Context context) {
              UpdateStatus status = new UpdateStatus();
  
@@ -517,23 +909,82 @@ new file mode 100644
 +        PostTask.postTask(UiThreadTaskTraits.DEFAULT, mCallback);
 +    }
 +}
+diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omaha/inline/InlineUpdateController.java b/chrome/android/java/src/org/chromium/chrome/browser/omaha/inline/InlineUpdateController.java
+new file mode 100644
+--- /dev/null
++++ b/chrome/android/java/src/org/chromium/chrome/browser/omaha/inline/InlineUpdateController.java
+@@ -0,0 +1,45 @@
++// Copyright 2019 The Chromium Authors. All rights reserved.
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++package org.chromium.chrome.browser.omaha.inline;
++
++import android.app.Activity;
++import android.content.Intent;
++
++import androidx.annotation.Nullable;
++
++import org.chromium.chrome.browser.omaha.UpdateStatusProvider;
++
++/**
++ * Helper for gluing interactions with the Play store's AppUpdateManager with Chrome.  This
++ * involves hooking up to Play as a listener for install state changes, should only happen if we are
++ * in the foreground.
++ */
++public interface InlineUpdateController {
++    /**
++     * Enables or disables the controller.
++     * @param enabled true iff the controller should be enabled.
++     */
++    void setEnabled(boolean enabled);
++
++    /**
++     * @return The current state of the inline update process.  May be {@code null} if the state
++     * hasn't been determined yet.
++     */
++    @Nullable
++    @UpdateStatusProvider.UpdateState
++    Integer getStatus();
++
++    /**
++     * Starts the update, if possible.  This will send an {@link Intent} out to play, which may
++     * cause Chrome to move to the background.
++     * @param activity The {@link Activity} to use to interact with Play.
++     */
++    void startUpdate(Activity activity);
++
++    /**
++     * Completes the Play installation process, if possible.  This may cause Chrome to restart.
++     */
++    void completeUpdate();
++}
 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omaha/inline/InlineUpdateControllerFactory.java b/chrome/android/java/src/org/chromium/chrome/browser/omaha/inline/InlineUpdateControllerFactory.java
---- a/chrome/android/java/src/org/chromium/chrome/browser/omaha/inline/InlineUpdateControllerFactory.java
+new file mode 100644
+--- /dev/null
 +++ b/chrome/android/java/src/org/chromium/chrome/browser/omaha/inline/InlineUpdateControllerFactory.java
-@@ -19,8 +19,10 @@ public class InlineUpdateControllerFactory {
-         @FakeAppUpdateManagerWrapper.Type
-         int mockInlineEndState = UpdateConfigs.getMockInlineScenarioEndState();
- 
--        // No test scenario was in place, and the inline flow has not been enabled, so use a
--        // controller with no functionality.
--        return new NoopInlineUpdateController(callback);
-+        if (ChromeFeatureList.isEnabled(ChromeFeatureList.INLINE_UPDATE_FLOW)) {
-+            return new BromiteInlineUpdateController(callback);
-+        } else {
-+            return new NoopInlineUpdateController(callback);
-+        }
-     }
- }
+@@ -0,0 +1,21 @@
++// Copyright 2019 The Chromium Authors. All rights reserved.
++// Use of this source code is governed by a BSD-style license that can be
++// found in the LICENSE file.
++
++package org.chromium.chrome.browser.omaha.inline;
++
++import org.chromium.base.ContextUtils;
++import org.chromium.chrome.browser.flags.ChromeFeatureList;
++import org.chromium.chrome.browser.omaha.UpdateConfigs;
++
++/**
++ * A factory that creates an {@link InlineUpdateController} instance.
++ */
++public class InlineUpdateControllerFactory {
++    /**
++     * @return A new {@link InlineUpdateController}.
++     */
++    public static InlineUpdateController create(Runnable callback) {
++        return new BromiteInlineUpdateController(callback);
++    }
++}
 diff --git a/chrome/browser/endpoint_fetcher/BUILD.gn b/chrome/browser/endpoint_fetcher/BUILD.gn
 --- a/chrome/browser/endpoint_fetcher/BUILD.gn
 +++ b/chrome/browser/endpoint_fetcher/BUILD.gn
@@ -591,7 +1042,7 @@ diff --git a/chrome/browser/endpoint_fetcher/endpoint_fetcher.cc b/chrome/browse
  EndpointFetcher::~EndpointFetcher() = default;
  
  void EndpointFetcher::Fetch(EndpointFetcherCallback endpoint_fetcher_callback) {
-@@ -293,6 +311,77 @@ std::string EndpointFetcher::GetUrlForTesting() {
+@@ -304,6 +322,77 @@ std::string EndpointFetcher::GetUrlForTesting() {
    return url_.spec();
  }
  
@@ -615,7 +1066,7 @@ diff --git a/chrome/browser/endpoint_fetcher/endpoint_fetcher.cc b/chrome/browse
 +  simple_url_loader_ = network::SimpleURLLoader::Create(
 +      std::move(resource_request), annotation_tag_);
 +  simple_url_loader_->SetTimeoutDuration(
-+      base::TimeDelta::FromMilliseconds(timeout_ms_));
++      base::Milliseconds(timeout_ms_));
 +  simple_url_loader_->SetAllowHttpErrorResults(true);
 +
 +  if (!response_)
@@ -669,7 +1120,7 @@ diff --git a/chrome/browser/endpoint_fetcher/endpoint_fetcher.cc b/chrome/browse
  #if defined(OS_ANDROID)
  namespace {
  static void OnEndpointFetcherComplete(
-@@ -309,6 +398,25 @@ static void OnEndpointFetcherComplete(
+@@ -320,6 +409,25 @@ static void OnEndpointFetcherComplete(
                         base::android::AttachCurrentThread(),
                         std::move(endpoint_response->response))));
  }
@@ -695,7 +1146,7 @@ diff --git a/chrome/browser/endpoint_fetcher/endpoint_fetcher.cc b/chrome/browse
  }  // namespace
  
  // TODO(crbug.com/1077537) Create a KeyProvider so
-@@ -398,4 +506,25 @@ static void JNI_EndpointFetcher_NativeFetchWithNoAuth(
+@@ -409,4 +517,25 @@ static void JNI_EndpointFetcher_NativeFetchWithNoAuth(
        nullptr);
  }
  
@@ -724,7 +1175,7 @@ diff --git a/chrome/browser/endpoint_fetcher/endpoint_fetcher.cc b/chrome/browse
 diff --git a/chrome/browser/endpoint_fetcher/endpoint_fetcher.h b/chrome/browser/endpoint_fetcher/endpoint_fetcher.h
 --- a/chrome/browser/endpoint_fetcher/endpoint_fetcher.h
 +++ b/chrome/browser/endpoint_fetcher/endpoint_fetcher.h
-@@ -14,6 +14,8 @@
+@@ -15,6 +15,8 @@
  #include "components/signin/public/identity_manager/scope_set.h"
  #include "net/traffic_annotation/network_traffic_annotation.h"
  #include "services/data_decoder/public/cpp/json_sanitizer.h"
@@ -733,7 +1184,7 @@ diff --git a/chrome/browser/endpoint_fetcher/endpoint_fetcher.h b/chrome/browser
  
  namespace network {
  struct ResourceRequest;
-@@ -31,6 +33,8 @@ class Profile;
+@@ -32,6 +34,8 @@ class Profile;
  
  struct EndpointResponse {
    std::string response;
@@ -742,7 +1193,7 @@ diff --git a/chrome/browser/endpoint_fetcher/endpoint_fetcher.h b/chrome/browser
    // TODO(crbug.com/993393) Add more detailed error messaging
  };
  
-@@ -77,6 +81,12 @@ class EndpointFetcher {
+@@ -78,6 +82,12 @@ class EndpointFetcher {
                    const GURL& url,
                    const net::NetworkTrafficAnnotationTag& annotation_tag);
  
@@ -755,7 +1206,7 @@ diff --git a/chrome/browser/endpoint_fetcher/endpoint_fetcher.h b/chrome/browser
    // Used for tests. Can be used if caller constructs their own
    // url_loader_factory and identity_manager.
    EndpointFetcher(
-@@ -117,6 +127,10 @@ class EndpointFetcher {
+@@ -118,6 +128,10 @@ class EndpointFetcher {
  
    std::string GetUrlForTesting();
  
@@ -766,7 +1217,7 @@ diff --git a/chrome/browser/endpoint_fetcher/endpoint_fetcher.h b/chrome/browser
   protected:
    // Used for Mock only. see MockEndpointFetcher class.
    explicit EndpointFetcher(
-@@ -130,6 +144,10 @@ class EndpointFetcher {
+@@ -131,6 +145,10 @@ class EndpointFetcher {
                           std::unique_ptr<std::string> response_body);
    void OnSanitizationResult(EndpointFetcherCallback endpoint_fetcher_callback,
                              data_decoder::JsonSanitizer::Result result);
@@ -777,7 +1228,7 @@ diff --git a/chrome/browser/endpoint_fetcher/endpoint_fetcher.h b/chrome/browser
  
    enum AuthType { CHROME_API_KEY, OAUTH, NO_AUTH };
    AuthType auth_type_;
-@@ -137,7 +155,7 @@ class EndpointFetcher {
+@@ -138,7 +156,7 @@ class EndpointFetcher {
    // Members set in constructor to be passed to network::ResourceRequest or
    // network::SimpleURLLoader.
    const std::string oauth_consumer_name_;
@@ -786,7 +1237,7 @@ diff --git a/chrome/browser/endpoint_fetcher/endpoint_fetcher.h b/chrome/browser
    const std::string http_method_;
    const std::string content_type_;
    int64_t timeout_ms_;
-@@ -157,6 +175,9 @@ class EndpointFetcher {
+@@ -158,6 +176,9 @@ class EndpointFetcher {
        access_token_fetcher_;
    std::unique_ptr<network::SimpleURLLoader> simple_url_loader_;
  
@@ -859,50 +1310,55 @@ new file mode 100644
 +        return new EndpointHeaderResponse(response, redirectUrl);
 +    }
 +}
-diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json
---- a/chrome/browser/flag-metadata.json
-+++ b/chrome/browser/flag-metadata.json
-@@ -2121,7 +2121,7 @@
-   {
-     "name": "enable-inline-update-flow",
-     "owners": [ "nyquist", "dtrainor" ],
--    "expiry_milestone": 83
-+    "expiry_milestone": -1
-   },
-   {
-     "name": "enable-input-event-logging",
-diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
---- a/chrome/browser/flag_descriptions.cc
-+++ b/chrome/browser/flag_descriptions.cc
-@@ -3657,10 +3657,9 @@ const char kVoiceButtonInTopToolbarDescription[] =
-     "Enables showing the voice search button in the top toolbar. Enabling "
-     "Adaptive Button overrides this.";
- 
--const char kInlineUpdateFlowName[] = "Enable Google Play inline update flow";
-+const char kInlineUpdateFlowName[] = "Enable inline update flow";
- const char kInlineUpdateFlowDescription[] =
--    "When this flag is set, instead of taking the user to the Google Play "
--    "Store when an update is available, the user is presented with an inline "
-+    "When this flag is set, the user is presented with an inline "
-     "flow where they do not have to leave Chrome until the update is ready "
-     "to install.";
- 
 diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc
 --- a/chrome/browser/flags/android/chrome_feature_list.cc
 +++ b/chrome/browser/flags/android/chrome_feature_list.cc
-@@ -631,7 +631,7 @@ const base::Feature kIncognitoScreenshot{"IncognitoScreenshot",
-                                          base::FEATURE_DISABLED_BY_DEFAULT};
+@@ -246,6 +246,7 @@ const base::Feature* const kFeaturesExposedToJava[] = {
+     &kNewWindowAppMenu,
+     &kOfflineIndicatorV2,
+     &kOfflineMeasurementsBackgroundTask,
++    &kInlineUpdateFlow,
+     &kPageAnnotationsService,
+     &kBookmarksImprovedSaveFlow,
+     &kBookmarksRefresh,
+@@ -654,7 +655,10 @@ const base::Feature kIncognitoReauthenticationForAndroid{
+     "IncognitoReauthenticationForAndroid", base::FEATURE_DISABLED_BY_DEFAULT};
  
- const base::Feature kInlineUpdateFlow{"InlineUpdateFlow",
--                                      base::FEATURE_DISABLED_BY_DEFAULT};
+ const base::Feature kIncognitoScreenshot{"IncognitoScreenshot",
+-                                         base::FEATURE_DISABLED_BY_DEFAULT};
++                                         base::FEATURE_ENABLED_BY_DEFAULT};
++
++const base::Feature kInlineUpdateFlow{"InlineUpdateFlow",
 +                                      base::FEATURE_ENABLED_BY_DEFAULT};
  
  const base::Feature kInstantStart{"InstantStart",
                                    base::FEATURE_DISABLED_BY_DEFAULT};
+diff --git a/chrome/browser/flags/android/chrome_feature_list.h b/chrome/browser/flags/android/chrome_feature_list.h
+--- a/chrome/browser/flags/android/chrome_feature_list.h
++++ b/chrome/browser/flags/android/chrome_feature_list.h
+@@ -106,6 +106,7 @@ extern const base::Feature kImmersiveUiMode;
+ extern const base::Feature kIncognitoReauthenticationForAndroid;
+ extern const base::Feature kIncognitoScreenshot;
+ extern const base::Feature kImprovedA2HS;
++extern const base::Feature kInlineUpdateFlow;
+ extern const base::Feature kInstanceSwitcher;
+ extern const base::Feature kInstantStart;
+ extern const base::Feature kKitKatSupported;
+diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
+--- a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
++++ b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
+@@ -361,6 +361,7 @@ public abstract class ChromeFeatureList {
+     public static final String INCOGNITO_REAUTHENTICATION_FOR_ANDROID =
+             "IncognitoReauthenticationForAndroid";
+     public static final String INCOGNITO_SCREENSHOT = "IncognitoScreenshot";
++    public static final String INLINE_UPDATE_FLOW = "InlineUpdateFlow";
+     public static final String INSTALLABLE_AMBIENT_BADGE_INFOBAR = "InstallableAmbientBadgeInfoBar";
+     public static final String INSTANCE_SWITCHER = "InstanceSwitcher";
+     public static final String INSTANT_START = "InstantStart";
 diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
 --- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
 +++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
-@@ -1703,6 +1703,12 @@ Your Google account may have other forms of browsing history like searches and a
+@@ -1824,6 +1824,12 @@ Your Google account may have other forms of browsing history like searches and a
        <message name="IDS_DEPRECATION_WARNING" desc="Warning about Chrome updates no longer being supported">
          Chrome updates are no longer supported for this version of Android
        </message>
@@ -915,7 +1371,7 @@ diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chro
  
        <!-- Account management UI strings. -->
        <message name="IDS_ACCOUNT_MANAGEMENT_TITLE" desc="Header title for the account management screen. [CHAR_LIMIT=32]">
-@@ -3199,7 +3205,7 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
+@@ -3344,7 +3350,7 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
  
        <!-- Main menu items -->
        <message name="IDS_MENU_UPDATE" desc="Menu item for updating chrome. [CHAR_LIMIT=24]">
@@ -924,6 +1380,24 @@ diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chro
        </message>
        <message name="IDS_MENU_UPDATE_SUMMARY_DEFAULT" desc="Summary string for update menu item explaining that a newer version of Chrome is available. [CHAR_LIMIT=30]">
          Newer version is available
--- 
-2.20.1
-
+@@ -3355,6 +3361,18 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
+       <message name="IDS_MENU_UPDATE_UNSUPPORTED_SUMMARY_DEFAULT" desc="Summary string for update menu item explaining that the Android version on the device is unsupported. [CHAR_LIMIT=30]">
+         Android version is unsupported
+       </message>
++      <message name="IDS_MENU_INLINE_UPDATE_DOWNLOADING" desc="Menu item for when Chrome is in the process of updating. [CHAR_LIMIT=24]">
++        Downloading…
++      </message>
++      <message name="IDS_MENU_INLINE_UPDATE_FAILED" desc="Menu item for when Chrome failed to download an update. [CHAR_LIMIT=24]">
++        Couldn’t download
++      </message>
++      <message name="IDS_MENU_INLINE_UPDATE_READY" desc="Menu item text that is shown when Chrome has downloaded an update for itself and is ready to be restarted, which will apply the update. [CHAR_LIMIT=24]">
++        Update ready
++      </message>
++      <message name="IDS_MENU_INLINE_UPDATE_READY_SUMMARY" desc="Summary text that is shown when Chrome has downloaded an update for itself and is ready to be restarted, which will apply the update.  This lets the user know the update will restart. [CHAR_LIMIT=24]">
++        Restart Bromite
++      </message>
+       <message name="IDS_MENU_NEW_WINDOW" desc="Menu item for opening a new window. [CHAR_LIMIT=27]">
+         New window
+       </message>
+--
+2.25.1

+ 22 - 0
build/patches/Bromite-package-name.patch

@@ -0,0 +1,22 @@
+From: csagan5 <32685696+csagan5@users.noreply.github.com>
+Date: Sat, 8 Jan 2022 19:42:34 +0100
+Subject: Bromite package name
+
+---
+ chrome/android/BUILD.gn | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
+--- a/chrome/android/BUILD.gn
++++ b/chrome/android/BUILD.gn
+@@ -43,7 +43,7 @@ if (android_64bit_target_cpu && skip_secondary_abi_for_cq) {
+   assert(current_toolchain != android_secondary_abi_toolchain)
+ }
+ 
+-_default_package = "org.chromium.chrome"
++_default_package = "org.bromite.bromite"
+ if (android_channel != "default" && android_channel != "stable") {
+   # android-binary-size trybot may checks if an internal Chrome variant's
+   # AndroidManifest is as expected by ensuring the differences between its
+--
+2.25.1

+ 4 - 5
build/patches/Change-default-webRTC-policy-to-not-use-any-address.patch

@@ -12,10 +12,10 @@ See also: https://github.com/bromite/bromite/issues/553
 diff --git a/third_party/blink/renderer/modules/peerconnection/peer_connection_dependency_factory.cc b/third_party/blink/renderer/modules/peerconnection/peer_connection_dependency_factory.cc
 --- a/third_party/blink/renderer/modules/peerconnection/peer_connection_dependency_factory.cc
 +++ b/third_party/blink/renderer/modules/peerconnection/peer_connection_dependency_factory.cc
-@@ -663,12 +663,13 @@ PeerConnectionDependencyFactory::CreatePortAllocator(
+@@ -777,12 +777,13 @@ PeerConnectionDependencyFactory::CreatePortAllocator(
            port_config.enable_nonproxied_udp = false;
            break;
-         case DEFAULT:
+         case kDefault:
 -          port_config.enable_multiple_routes = true;
 -          port_config.enable_nonproxied_udp = true;
 +          port_config.enable_multiple_routes = false;
@@ -29,6 +29,5 @@ diff --git a/third_party/blink/renderer/modules/peerconnection/peer_connection_d
                << "policy: " << policy
                << ", multiple_routes: " << port_config.enable_multiple_routes
                << ", nonproxied_udp: " << port_config.enable_nonproxied_udp
--- 
-2.20.1
-
+--
+2.25.1

+ 22 - 0
build/patches/Chromium-package-name.patch

@@ -0,0 +1,22 @@
+From: csagan5 <32685696+csagan5@users.noreply.github.com>
+Date: Sat, 8 Jan 2022 19:42:34 +0100
+Subject: Chromium package name
+
+---
+ chrome/android/BUILD.gn | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
+--- a/chrome/android/BUILD.gn
++++ b/chrome/android/BUILD.gn
+@@ -43,7 +43,7 @@ if (android_64bit_target_cpu && skip_secondary_abi_for_cq) {
+   assert(current_toolchain != android_secondary_abi_toolchain)
+ }
+ 
+-_default_package = "org.chromium.chrome"
++_default_package = "org.bromite.chromium"
+ if (android_channel != "default" && android_channel != "stable") {
+   # android-binary-size trybot may checks if an internal Chrome variant's
+   # AndroidManifest is as expected by ensuring the differences between its
+--
+2.25.1

+ 58 - 0
build/patches/Client-hints-overrides.patch

@@ -0,0 +1,58 @@
+From: csagan5 <32685696+csagan5@users.noreply.github.com>
+Date: Thu, 22 Jul 2021 23:10:52 +0200
+Subject: Client hints overrides
+
+Disable critical client hints
+Hard-code model to SAMSUNG SM-G960U
+use Google Chrome branding for client hints
+---
+ components/embedder_support/user_agent_utils.cc | 4 +---
+ content/common/user_agent.cc                    | 7 +------
+ content/public/common/content_features.cc       | 2 +-
+ 3 files changed, 3 insertions(+), 10 deletions(-)
+
+diff --git a/components/embedder_support/user_agent_utils.cc b/components/embedder_support/user_agent_utils.cc
+--- a/components/embedder_support/user_agent_utils.cc
++++ b/components/embedder_support/user_agent_utils.cc
+@@ -168,9 +168,7 @@ const blink::UserAgentBrandList GetUserAgentBrandList(
+   int major_version_number = 0;
+   DCHECK(base::StringToInt(major_version, &major_version_number));
+   absl::optional<std::string> brand;
+-#if !BUILDFLAG(CHROMIUM_BRANDING)
+-  brand = version_info::GetProductName();
+-#endif
++  brand = "Google Chrome";
+   absl::optional<std::string> maybe_brand_override =
+       base::GetFieldTrialParamValueByFeature(features::kGreaseUACH,
+                                              "brand_override");
+diff --git a/content/common/user_agent.cc b/content/common/user_agent.cc
+--- a/content/common/user_agent.cc
++++ b/content/common/user_agent.cc
+@@ -285,12 +285,7 @@ std::string BuildUserAgentFromProduct(const std::string& product) {
+ 
+ std::string BuildModelInfo() {
+   std::string model;
+-#if defined(OS_ANDROID)
+-  // Only send the model information if on the release build of Android,
+-  // matching user agent behaviour.
+-  if (base::SysInfo::GetAndroidBuildCodename() == "REL")
+-    model = base::SysInfo::HardwareModelName();
+-#endif
++  model = "SAMSUNG SM-G960U";
+   return model;
+ }
+ 
+diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc
+--- a/content/public/common/content_features.cc
++++ b/content/public/common/content_features.cc
+@@ -232,7 +232,7 @@ const base::Feature kCrashReporting{"CrashReporting",
+ // Enables support for the `Critical-CH` response header.
+ // https://github.com/WICG/client-hints-infrastructure/blob/master/reliability.md#critical-ch
+ const base::Feature kCriticalClientHint{"CriticalClientHint",
+-                                        base::FEATURE_ENABLED_BY_DEFAULT};
++                                        base::FEATURE_DISABLED_BY_DEFAULT};
+ 
+ // Enable cross-origin sharing of WebAssembly modules.
+ const base::Feature kCrossOriginWebAssemblyModuleSharingEnabled{
+--
+2.25.1

+ 5 - 6
build/patches/Disable-AGSA-by-default.patch

@@ -10,7 +10,7 @@ Subject: Disable AGSA by default
 diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc
 --- a/chrome/browser/flags/android/chrome_feature_list.cc
 +++ b/chrome/browser/flags/android/chrome_feature_list.cc
-@@ -609,7 +609,7 @@ const base::Feature kEnhancedProtectionPromoCard{
+@@ -629,7 +629,7 @@ const base::Feature kEnhancedProtectionPromoCard{
      "EnhancedProtectionPromoCard", base::FEATURE_DISABLED_BY_DEFAULT};
  
  const base::Feature kExperimentsForAgsa{"ExperimentsForAgsa",
@@ -22,15 +22,14 @@ diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browse
 diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java
 --- a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java
 +++ b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java
-@@ -85,7 +85,7 @@ public class CachedFeatureFlags {
+@@ -90,7 +90,7 @@ public class CachedFeatureFlags {
                      .put(ChromeFeatureList.CCT_REMOVE_REMOTE_VIEW_IDS, true)
                      .put(ChromeFeatureList.OFFLINE_MEASUREMENTS_BACKGROUND_TASK, false)
                      .put(ChromeFeatureList.CCT_INCOGNITO, true)
 -                    .put(ChromeFeatureList.EXPERIMENTS_FOR_AGSA, true)
 +                    .put(ChromeFeatureList.EXPERIMENTS_FOR_AGSA, false)
                      .put(ChromeFeatureList.APP_MENU_MOBILE_SITE_OPTION, false)
-                     .put(ChromeFeatureList.CLIPBOARD_SUGGESTION_CONTENT_HIDDEN, false)
                      .put(ChromeFeatureList.OPTIMIZATION_GUIDE_PUSH_NOTIFICATIONS, false)
--- 
-2.20.1
-
+                     .put(ChromeFeatureList.APP_TO_WEB_ATTRIBUTION, false)
+--
+2.25.1

+ 58 - 0
build/patches/Disable-Accessibility-service-by-default.patch

@@ -0,0 +1,58 @@
+From: uazo <uazo@users.noreply.github.com>
+Date: Mon, 8 Nov 2021 09:47:23 +0000
+Subject: Disable Accessibility service by default
+
+---
+ chrome/android/java/res/xml/accessibility_preferences.xml   | 5 +++++
+ .../browser/ui/android/strings/android_chrome_strings.grd   | 6 ++++++
+ .../browser/accessibility/WebContentsAccessibilityImpl.java | 5 +++++
+ 3 files changed, 16 insertions(+)
+
+diff --git a/chrome/android/java/res/xml/accessibility_preferences.xml b/chrome/android/java/res/xml/accessibility_preferences.xml
+--- a/chrome/android/java/res/xml/accessibility_preferences.xml
++++ b/chrome/android/java/res/xml/accessibility_preferences.xml
+@@ -5,6 +5,11 @@
+ 
+ <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
+ 
++    <org.chromium.components.browser_ui.settings.ChromeBaseCheckBoxPreference
++        android:key="enable_accessibility"
++        android:summary="@string/enable_accessibility_summary"
++        android:title="@string/enable_accessibility_title" />
++
+     <org.chromium.chrome.browser.accessibility.settings.TextScalePreference
+         android:key="text_scale"
+         android:title="@string/font_size"
+diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
+--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
++++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
+@@ -1413,6 +1413,12 @@ Your Google account may have other forms of browsing history like searches and a
+       <message name="IDS_PREFS_ACCESSIBILITY" desc="Title of Accessibility settings, which allows the user to change webpage font sizes. [CHAR_LIMIT=32]">
+         Accessibility
+       </message>
++      <message name="IDS_ENABLE_ACCESSIBILITY_TITLE" desc="Title of enable accessibility settings, which allows the user to enable service. [CHAR_LIMIT=32]">
++        Enable Accessibility Service
++      </message>
++      <message name="IDS_ENABLE_ACCESSIBILITY_SUMMARY" desc="Summary of enable accessibility settings.">
++        Activates or deactivates the communication of all user activities in ui to the Accessibility provider
++      </message>
+       <message name="IDS_FONT_SIZE" desc="Title for font size preference.">
+         Text scaling
+       </message>
+diff --git a/content/public/android/java/src/org/chromium/content/browser/accessibility/WebContentsAccessibilityImpl.java b/content/public/android/java/src/org/chromium/content/browser/accessibility/WebContentsAccessibilityImpl.java
+--- a/content/public/android/java/src/org/chromium/content/browser/accessibility/WebContentsAccessibilityImpl.java
++++ b/content/public/android/java/src/org/chromium/content/browser/accessibility/WebContentsAccessibilityImpl.java
+@@ -791,6 +791,11 @@ public class WebContentsAccessibilityImpl extends AccessibilityNodeProvider
+             structure.setChildCount(0);
+             return;
+         }
++        // Do not collect accessibility tree if disabled
++        if (!ContextUtils.getAppSharedPreferences().getBoolean("enable_accessibility", false)) {
++            structure.setChildCount(0);
++            return;
++        }
+         structure.setChildCount(1);
+         final ViewStructure viewRoot = structure.asyncNewChild(0);
+         viewRoot.setClassName("");
+--
+2.25.1

+ 3 - 4
build/patches/Disable-DRM-media-origin-IDs-preprovisioning.patch

@@ -9,7 +9,7 @@ Subject: Disable DRM media origin IDs preprovisioning
 diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc
 --- a/media/base/media_switches.cc
 +++ b/media/base/media_switches.cc
-@@ -645,7 +645,7 @@ const base::Feature kMediaDrmPersistentLicense{
+@@ -655,7 +655,7 @@ const base::Feature kMediaDrmPersistentLicense{
  // MediaDrmBridge. If disabled, MediaDrmBridge will get unprovisioned origin IDs
  // which will trigger provisioning process after MediaDrmBridge is created.
  const base::Feature kMediaDrmPreprovisioning{"MediaDrmPreprovisioning",
@@ -18,6 +18,5 @@ diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc
  
  // Determines if MediaDrmOriginIdManager should attempt to pre-provision origin
  // IDs at startup (whenever a profile is loaded). Also used by tests that
--- 
-2.20.1
-
+--
+2.25.1

+ 518 - 0
build/patches/Disable-FLoC.patch

@@ -0,0 +1,518 @@
+From: uazo <uazo@users.noreply.github.com>
+Date: Sat, 13 Nov 2021 18:02:15 +0000
+Subject: Disable FLoC
+
+Permanently removes floc support, disabling the download of lsh clusters,
+the marking the history navigation and the javascript api and permission policies.
+Also added the disabling of blink features through the DisabledForBromite tag
+---
+ .../browser/chrome_content_browser_client.cc  |  4 ++
+ .../floc_component_installer.cc               | 10 +---
+ .../floc_eligibility_observer.cc              | 58 +------------------
+ .../floc_id_provider_impl.cc                  |  4 +-
+ .../privacy_sandbox_settings.cc               | 14 +++--
+ .../federated_learning/features/features.cc   | 12 ++--
+ components/federated_learning/floc_id.cc      | 19 +++---
+ .../history/core/browser/history_backend.cc   | 13 +----
+ .../history/core/browser/history_service.cc   |  9 +--
+ components/history/core/browser/url_row.h     |  1 -
+ third_party/blink/common/features.cc          |  4 +-
+ .../permissions_policy_feature.mojom          |  5 --
+ .../renderer/bindings/generated_in_core.gni   |  2 -
+ .../blink/renderer/core/dom/document.cc       | 31 +---------
+ .../blink/renderer/core/dom/document.idl      |  1 -
+ .../renderer/core/dom/interest_cohort.idl     |  4 --
+ .../permissions_policy_features.json5         |  6 --
+ .../platform/runtime_enabled_features.json5   |  5 +-
+ 18 files changed, 38 insertions(+), 164 deletions(-)
+
+diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
+--- a/chrome/browser/chrome_content_browser_client.cc
++++ b/chrome/browser/chrome_content_browser_client.cc
+@@ -2798,6 +2798,10 @@ bool ChromeContentBrowserClient::IsConversionMeasurementOperationAllowed(
+     const url::Origin* impression_origin,
+     const url::Origin* conversion_origin,
+     const url::Origin* reporting_origin) {
++  // redundant code, privacy sandbox is already disabled in the prefs
++  // but I leave it anyway for now
++  if ((true))
++    return false;
+   Profile* profile = Profile::FromBrowserContext(browser_context);
+ 
+   PrivacySandboxSettings* privacy_sandbox_settings =
+diff --git a/chrome/browser/component_updater/floc_component_installer.cc b/chrome/browser/component_updater/floc_component_installer.cc
+--- a/chrome/browser/component_updater/floc_component_installer.cc
++++ b/chrome/browser/component_updater/floc_component_installer.cc
+@@ -19,7 +19,7 @@ namespace component_updater {
+ // The extension id is: cmahhnpholdijhjokonmfdjbfmklppij
+ constexpr uint8_t kFlocComponentPublicKeySHA256[32] = {
+     0x2c, 0x07, 0x7d, 0xf7, 0xeb, 0x38, 0x97, 0x9e, 0xae, 0xdc, 0x53,
+-    0x91, 0x5c, 0xab, 0xff, 0x89, 0xbc, 0xf0, 0xd9, 0x30, 0xd2, 0x2e,
++    0x01, 0x02, 0x03, 0x04, 0x89, 0xbc, 0xf0, 0xd9, 0x30, 0xd2, 0x2e,
+     0x8f, 0x68, 0x3a, 0xf9, 0x21, 0x91, 0x9f, 0xc1, 0x84, 0xa1};
+ 
+ constexpr char kFlocComponentFetcherManifestName[] =
+@@ -56,10 +56,6 @@ void FlocComponentInstallerPolicy::ComponentReady(
+     const base::FilePath& install_dir,
+     base::Value manifest) {
+   DCHECK(!install_dir.empty());
+-
+-  floc_sorting_lsh_clusters_service_->OnSortingLshClustersFileReady(
+-      install_dir.Append(federated_learning::kSortingLshClustersFileName),
+-      version);
+ }
+ 
+ // Called during startup and installation before ComponentReady().
+@@ -102,10 +98,6 @@ void RegisterFlocComponent(
+     ComponentUpdateService* cus,
+     federated_learning::FlocSortingLshClustersService*
+         floc_sorting_lsh_clusters_service) {
+-  auto installer = base::MakeRefCounted<ComponentInstaller>(
+-      std::make_unique<FlocComponentInstallerPolicy>(
+-          floc_sorting_lsh_clusters_service));
+-  installer->Register(cus, base::OnceClosure());
+ }
+ 
+ }  // namespace component_updater
+diff --git a/chrome/browser/federated_learning/floc_eligibility_observer.cc b/chrome/browser/federated_learning/floc_eligibility_observer.cc
+--- a/chrome/browser/federated_learning/floc_eligibility_observer.cc
++++ b/chrome/browser/federated_learning/floc_eligibility_observer.cc
+@@ -17,55 +17,14 @@
+ 
+ namespace federated_learning {
+ 
+-namespace {
+-
+-history::HistoryService* GetHistoryService(content::WebContents* web_contents) {
+-  DCHECK(web_contents);
+-
+-  Profile* profile =
+-      Profile::FromBrowserContext(web_contents->GetBrowserContext());
+-  if (profile->IsOffTheRecord())
+-    return nullptr;
+-
+-  return HistoryServiceFactory::GetForProfile(
+-      profile, ServiceAccessType::IMPLICIT_ACCESS);
+-}
+-
+-}  // namespace
+-
+ FlocEligibilityObserver::~FlocEligibilityObserver() = default;
+ 
+ page_load_metrics::PageLoadMetricsObserver::ObservePolicy
+ FlocEligibilityObserver::OnCommit(
+     content::NavigationHandle* navigation_handle) {
+-  // At this point the add-page-to-history decision should have been made,
+-  // because history is added in HistoryTabHelper::DidFinishNavigation, and this
+-  // OnEligibleCommit method is invoked in the same broadcasting family through
+-  // MetricsWebContentsObserver::DidFinishNavigation.
+-
+-  // TODO(yaoxia): Perhaps we want an explicit signal for "the page was added
+-  // to history or was ineligible". This way we don't need to count on the above
+-  // relation, and can also stop observing if the history was not added.
+-
+-  // If the IP was not publicly routable, the navigation history is not eligible
+-  // for floc. We can stop observing now.
+-  if (!navigation_handle->GetSocketAddress().address().IsPubliclyRoutable() &&
+-      !base::FeatureList::IsEnabled(kFlocBypassIPIsPubliclyRoutableCheck)) {
+-    return ObservePolicy::STOP_OBSERVING;
+-  }
+-
+-  // If the interest-cohort permissions policy in the main document disallows
+-  // the floc inclusion, the navigation history is not eligible for floc. We can
+-  // stop observing now.
+-  if (!navigation_handle->GetRenderFrameHost()->IsFeatureEnabled(
+-          blink::mojom::PermissionsPolicyFeature::kInterestCohort)) {
+-    return ObservePolicy::STOP_OBSERVING;
+-  }
+-
+-  DCHECK(!eligible_commit_);
+-  eligible_commit_ = true;
+-
+-  return ObservePolicy::CONTINUE_OBSERVING;
++  // do not mark navigation as interesting for floc
++  // see https://github.com/WICG/floc#sites-which-interest-cohorts-will-be-calculated-on
++  return ObservePolicy::STOP_OBSERVING;
+ }
+ 
+ void FlocEligibilityObserver::OnAdResource() {
+@@ -86,17 +45,6 @@ FlocEligibilityObserver::FlocEligibilityObserver(content::RenderFrameHost* rfh)
+       web_contents_(content::WebContents::FromRenderFrameHost(rfh)) {}
+ 
+ void FlocEligibilityObserver::OnOptInSignalObserved() {
+-  if (!eligible_commit_ || observed_opt_in_signal_)
+-    return;
+-
+-  if (history::HistoryService* hs = GetHistoryService(web_contents_)) {
+-    hs->SetFlocAllowed(
+-        history::ContextIDForWebContents(web_contents_),
+-        web_contents_->GetController().GetLastCommittedEntry()->GetUniqueID(),
+-        web_contents_->GetLastCommittedURL());
+-  }
+-
+-  observed_opt_in_signal_ = true;
+ }
+ 
+ DOCUMENT_USER_DATA_KEY_IMPL(FlocEligibilityObserver);
+diff --git a/chrome/browser/federated_learning/floc_id_provider_impl.cc b/chrome/browser/federated_learning/floc_id_provider_impl.cc
+--- a/chrome/browser/federated_learning/floc_id_provider_impl.cc
++++ b/chrome/browser/federated_learning/floc_id_provider_impl.cc
+@@ -396,10 +396,8 @@ void FlocIdProviderImpl::OnGetRecentlyVisitedURLsCompleted(
+   base::Time history_end_time = base::Time::Min();
+ 
+   for (const history::URLResult& url_result : results) {
+-    if (!(url_result.content_annotations().annotation_flags &
+-          history::VisitContentAnnotationFlag::kFlocEligibleRelaxed)) {
++    if ((true))
+       continue;
+-    }
+ 
+     if (url_result.visit_time() < history_begin_time)
+       history_begin_time = url_result.visit_time();
+diff --git a/chrome/browser/privacy_sandbox/privacy_sandbox_settings.cc b/chrome/browser/privacy_sandbox/privacy_sandbox_settings.cc
+--- a/chrome/browser/privacy_sandbox/privacy_sandbox_settings.cc
++++ b/chrome/browser/privacy_sandbox/privacy_sandbox_settings.cc
+@@ -181,6 +181,9 @@ PrivacySandboxSettings::PrivacySandboxSettings(
+ 
+   // as default, privacy sandbox is disabled
+   pref_service_->SetBoolean(prefs::kPrivacySandboxApisEnabled, false);
++  // as default, floc is not enabled
++  pref_service_->SetBoolean(prefs::kPrivacySandboxFlocEnabled, false);
++
+   // On first entering the privacy sandbox experiment, users may have the
+   // privacy sandbox disabled (or "reconciled") based on their current cookie
+   // settings (e.g. blocking 3P cookies). Depending on the state of the sync
+@@ -291,7 +294,8 @@ bool PrivacySandboxSettings::IsFlocPrefEnabled() const {
+ }
+ 
+ void PrivacySandboxSettings::SetFlocPrefEnabled(bool enabled) const {
+-  pref_service_->SetBoolean(prefs::kPrivacySandboxFlocEnabled, enabled);
++  // never enable floc
++  pref_service_->SetBoolean(prefs::kPrivacySandboxFlocEnabled, false);
+   base::RecordAction(base::UserMetricsAction(
+       enabled ? "Settings.PrivacySandbox.FlocEnabled"
+               : "Settings.PrivacySandbox.FlocDisabled"));
+@@ -444,6 +448,7 @@ void PrivacySandboxSettings::MaybeReconcilePrivacySandboxPref() {
+   // this code could be eliminated in the future, as initially
+   // the feauture was tied to the cookies flag
+   pref_service_->SetBoolean(prefs::kPrivacySandboxApisEnabled, false);
++  pref_service_->SetBoolean(prefs::kPrivacySandboxFlocEnabled, false);
+   if((true))
+     return;
+ 
+@@ -542,11 +547,8 @@ void PrivacySandboxSettings::ReconcilePrivacySandboxPref() {
+ 
+ void PrivacySandboxSettings::SetFlocDataAccessibleFromNow(
+     bool reset_calculate_timer) const {
+-  pref_service_->SetTime(prefs::kPrivacySandboxFlocDataAccessibleSince,
+-                         base::Time::Now());
+-
+-  for (auto& observer : observers_)
+-    observer.OnFlocDataAccessibleSinceUpdated(reset_calculate_timer);
++  // don't tell anyone, thanks.
++  pref_service_->ClearPref(prefs::kPrivacySandboxFlocDataAccessibleSince);
+ }
+ 
+ void PrivacySandboxSettings::StopObserving() {
+diff --git a/components/federated_learning/features/features.cc b/components/federated_learning/features/features.cc
+--- a/components/federated_learning/features/features.cc
++++ b/components/federated_learning/features/features.cc
+@@ -12,13 +12,13 @@ namespace federated_learning {
+ // bypassed when determining the eligibility for a page to be included in floc
+ // computation. This is useful for developers to test FLoC in local environment.
+ const base::Feature kFlocBypassIPIsPubliclyRoutableCheck{
+-    "FlocBypassIPIsPubliclyRoutableCheck", base::FEATURE_DISABLED_BY_DEFAULT};
++    "FlocBypassIPIsPubliclyRoutableCheck", base::FEATURE_DISABLED_BY_DEFAULT}; // guard this
+ 
+ // Enables or disables the FlocIdComputed event logging, which happens when a
+ // floc id is first computed for a browsing session or is refreshed due to a
+ // long period of time has passed since the last computation.
+ const base::Feature kFlocIdComputedEventLogging{
+-    "FlocIdComputedEventLogging", base::FEATURE_ENABLED_BY_DEFAULT};
++    "FlocIdComputedEventLogging", base::FEATURE_DISABLED_BY_DEFAULT};
+ 
+ // If enabled, pages that had ad resources will be included in floc computation;
+ // otherwise, only pages that used the document.interestCohort API will be
+@@ -27,18 +27,18 @@ const base::Feature kFlocIdComputedEventLogging{
+ // criteria.
+ const base::Feature kFlocPagesWithAdResourcesDefaultIncludedInFlocComputation{
+     "FlocPagesWithAdResourcesDefaultIncludedInFlocComputation",
+-    base::FEATURE_DISABLED_BY_DEFAULT};
++    base::FEATURE_DISABLED_BY_DEFAULT}; // guard this
+ 
+ // The main floc feature for all the subsidiary control and setting params. It's
+ // controlling the floc update rate, and the minimum history domain size
+ // required.
+ // TODO(yaoxia): merge other floc features into this one.
+ const base::Feature kFederatedLearningOfCohorts{
+-    "FederatedLearningOfCohorts", base::FEATURE_DISABLED_BY_DEFAULT};
++    "FederatedLearningOfCohorts", base::FEATURE_DISABLED_BY_DEFAULT}; // guard this
+ constexpr base::FeatureParam<base::TimeDelta> kFlocIdScheduledUpdateInterval{
+-    &kFederatedLearningOfCohorts, "update_interval", base::Days(7)};
++    &kFederatedLearningOfCohorts, "update_interval", base::Days(1)};
+ constexpr base::FeatureParam<int> kFlocIdMinimumHistoryDomainSizeRequired{
+-    &kFederatedLearningOfCohorts, "minimum_history_domain_size_required", 3};
++    &kFederatedLearningOfCohorts, "minimum_history_domain_size_required", 99999};
+ constexpr base::FeatureParam<int> kFlocIdFinchConfigVersion{
+     &kFederatedLearningOfCohorts, "finch_config_version", 1};
+ 
+diff --git a/components/federated_learning/floc_id.cc b/components/federated_learning/floc_id.cc
+--- a/components/federated_learning/floc_id.cc
++++ b/components/federated_learning/floc_id.cc
+@@ -38,9 +38,8 @@ FlocId FlocId::CreateValid(uint64_t id,
+                            base::Time history_begin_time,
+                            base::Time history_end_time,
+                            uint32_t sorting_lsh_version) {
+-  return FlocId(id, Status::kValid, history_begin_time, history_end_time,
+-                kFlocIdFinchConfigVersion.Get(), sorting_lsh_version,
+-                /*compute_time=*/base::Time::Now());
++  // always return an invalid floc id
++  return CreateInvalid(Status::kInvalidBlocked);
+ }
+ 
+ FlocId::FlocId(const FlocId& id) = default;
+@@ -100,15 +99,7 @@ void FlocId::RegisterPrefs(PrefRegistrySimple* registry) {
+ }
+ 
+ void FlocId::SaveToPrefs(PrefService* prefs) {
+-  DCHECK_NE(status_, Status::kInvalidNoStatusPrefs);
+-
+-  prefs->SetUint64(kFlocIdValuePrefKey, id_);
+-  prefs->SetInteger(kFlocIdStatusPrefKey, static_cast<int>(status_));
+-  prefs->SetTime(kFlocIdHistoryBeginTimePrefKey, history_begin_time_);
+-  prefs->SetTime(kFlocIdHistoryEndTimePrefKey, history_end_time_);
+-  prefs->SetUint64(kFlocIdFinchConfigVersionPrefKey, finch_config_version_);
+-  prefs->SetUint64(kFlocIdSortingLshVersionPrefKey, sorting_lsh_version_);
+-  prefs->SetTime(kFlocIdComputeTimePrefKey, compute_time_);
++  // don't save anything
+ }
+ 
+ void FlocId::UpdateStatusAndSaveToPrefs(PrefService* prefs, Status status) {
+@@ -126,6 +117,10 @@ void FlocId::ResetComputeTimeAndSaveToPrefs(base::Time compute_time,
+ 
+ // static
+ FlocId FlocId::ReadFromPrefs(PrefService* prefs) {
++  // don't load anything
++  if ((true))
++    return CreateInvalid(FlocId::Status::kInvalidBlocked);
++
+   Status status = Status::kInvalidNoStatusPrefs;
+ 
+   // We rely on the time to tell whether it's a fresh profile.
+diff --git a/components/history/core/browser/history_backend.cc b/components/history/core/browser/history_backend.cc
+--- a/components/history/core/browser/history_backend.cc
++++ b/components/history/core/browser/history_backend.cc
+@@ -486,18 +486,7 @@ void HistoryBackend::SetFlocAllowed(ContextID context_id,
+   if (!visit_id)
+     return;
+ 
+-  // Only add to the annotations table if the visit_id exists in the visits
+-  // table.
+-  VisitContentAnnotations annotations;
+-  if (db_->GetContentAnnotationsForVisit(visit_id, &annotations)) {
+-    annotations.annotation_flags |=
+-        VisitContentAnnotationFlag::kFlocEligibleRelaxed;
+-    db_->UpdateContentAnnotationsForVisit(visit_id, annotations);
+-  } else {
+-    annotations.annotation_flags |=
+-        VisitContentAnnotationFlag::kFlocEligibleRelaxed;
+-    db_->AddContentAnnotationsForVisit(visit_id, annotations);
+-  }
++  // we don't want anyone to mark history as floc enabled
+   ScheduleCommit();
+ }
+ 
+diff --git a/components/history/core/browser/history_service.cc b/components/history/core/browser/history_service.cc
+--- a/components/history/core/browser/history_service.cc
++++ b/components/history/core/browser/history_service.cc
+@@ -383,7 +383,7 @@ void HistoryService::AddPage(const GURL& url,
+   AddPage(HistoryAddPageArgs(
+       url, time, context_id, nav_entry_id, referrer, redirects, transition,
+       !ui::PageTransitionIsMainFrame(transition), visit_source,
+-      did_replace_entry, /*consider_for_ntp_most_visited=*/true, floc_allowed));
++      did_replace_entry, /*consider_for_ntp_most_visited=*/true, /*floc_allowed*/false));
+ }
+ 
+ void HistoryService::AddPage(const GURL& url,
+@@ -463,12 +463,7 @@ void HistoryService::UpdateWithPageEndTime(ContextID context_id,
+ void HistoryService::SetFlocAllowed(ContextID context_id,
+                                     int nav_entry_id,
+                                     const GURL& url) {
+-  TRACE_EVENT0("browser", "HistoryService::SetFlocAllowed");
+-  DCHECK(backend_task_runner_) << "History service being called after cleanup";
+-  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+-  ScheduleTask(PRIORITY_NORMAL,
+-               base::BindOnce(&HistoryBackend::SetFlocAllowed, history_backend_,
+-                              context_id, nav_entry_id, url));
++  // we don't want anyone to mark history as floc enabled
+ }
+ 
+ void HistoryService::AddContentModelAnnotationsForVisit(
+diff --git a/components/history/core/browser/url_row.h b/components/history/core/browser/url_row.h
+--- a/components/history/core/browser/url_row.h
++++ b/components/history/core/browser/url_row.h
+@@ -166,7 +166,6 @@ enum VisitContentAnnotationFlag : uint64_t {
+   // 3. Page opted in / Either one of the following holds:
+   //      - document.interestCohort API is used in the page
+   //      - the page has heuristically detected ad resources
+-  kFlocEligibleRelaxed = 1 << 0,
+ };
+ 
+ using VisitContentAnnotationFlags = uint64_t;
+diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/features.cc
+--- a/third_party/blink/common/features.cc
++++ b/third_party/blink/common/features.cc
+@@ -890,11 +890,11 @@ const base::Feature kSendCnameAliasesToSubresourceFilterFromRenderer{
+ // API exposure will be disabled regardless of the OT config.
+ // (See https://github.com/WICG/floc.)
+ const base::Feature kInterestCohortAPIOriginTrial{
+-    "InterestCohortAPIOriginTrial", base::FEATURE_DISABLED_BY_DEFAULT};
++    "InterestCohortAPIOriginTrial", base::FEATURE_DISABLED_BY_DEFAULT}; // guard this
+ 
+ // Enable the availability of the "interest-cohort" permissions policy.
+ const base::Feature kInterestCohortFeaturePolicy{
+-    "InterestCohortFeaturePolicy", base::FEATURE_DISABLED_BY_DEFAULT};
++    "InterestCohortFeaturePolicy", base::FEATURE_DISABLED_BY_DEFAULT}; // guard this
+ 
+ const base::Feature kDisableDocumentDomainByDefault{
+     "DisableDocumentDomainByDefault", base::FEATURE_DISABLED_BY_DEFAULT};
+diff --git a/third_party/blink/public/mojom/permissions_policy/permissions_policy_feature.mojom b/third_party/blink/public/mojom/permissions_policy/permissions_policy_feature.mojom
+--- a/third_party/blink/public/mojom/permissions_policy/permissions_policy_feature.mojom
++++ b/third_party/blink/public/mojom/permissions_policy/permissions_policy_feature.mojom
+@@ -125,11 +125,6 @@ enum PermissionsPolicyFeature {
+   // Controls access to screen capture via getDisplayMedia().
+   kDisplayCapture = 81,
+ 
+-  // Controls the access to the interest cohort as well as the eligibility for
+-  // the navigation history entry to be included in the interest cohort
+-  // computation. (https://github.com/WICG/floc)
+-  kInterestCohort = 82,
+-
+   // Controls whether Autofill may fill fields in that frame when triggered on
+   // a field with the main frame's origin.
+   kSharedAutofill = 83,
+diff --git a/third_party/blink/renderer/bindings/generated_in_core.gni b/third_party/blink/renderer/bindings/generated_in_core.gni
+--- a/third_party/blink/renderer/bindings/generated_in_core.gni
++++ b/third_party/blink/renderer/bindings/generated_in_core.gni
+@@ -203,8 +203,6 @@ generated_dictionary_sources_in_core = [
+   "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_input_device_capabilities_init.h",
+   "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_input_event_init.cc",
+   "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_input_event_init.h",
+-  "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_interest_cohort.cc",
+-  "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_interest_cohort.h",
+   "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_intersection_observer_init.cc",
+   "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_intersection_observer_init.h",
+   "$root_gen_dir/third_party/blink/renderer/bindings/core/v8/v8_intrinsic_sizes_result_options.cc",
+diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink/renderer/core/dom/document.cc
+--- a/third_party/blink/renderer/core/dom/document.cc
++++ b/third_party/blink/renderer/core/dom/document.cc
+@@ -79,7 +79,6 @@
+ #include "third_party/blink/renderer/bindings/core/v8/source_location.h"
+ #include "third_party/blink/renderer/bindings/core/v8/v8_element_creation_options.h"
+ #include "third_party/blink/renderer/bindings/core/v8/v8_element_registration_options.h"
+-#include "third_party/blink/renderer/bindings/core/v8/v8_interest_cohort.h"
+ #include "third_party/blink/renderer/bindings/core/v8/v8_throw_dom_exception.h"
+ #include "third_party/blink/renderer/bindings/core/v8/v8_union_elementcreationoptions_string.h"
+ #include "third_party/blink/renderer/bindings/core/v8/v8_union_htmlscriptelement_svgscriptelement.h"
+@@ -6043,8 +6042,7 @@ ScriptPromise Document::interestCohort(ScriptState* script_state,
+     return ScriptPromise();
+   }
+ 
+-  if (!GetExecutionContext()->IsFeatureEnabled(
+-          mojom::blink::PermissionsPolicyFeature::kInterestCohort)) {
++  if ((true)) {
+     exception_state.ThrowDOMException(
+         DOMExceptionCode::kInvalidAccessError,
+         "The \"interest-cohort\" Permissions Policy denied the use of "
+@@ -6056,33 +6054,6 @@ ScriptPromise Document::interestCohort(ScriptState* script_state,
+       MakeGarbageCollected<ScriptPromiseResolver>(script_state);
+ 
+   ScriptPromise promise = resolver->Promise();
+-
+-  GetFlocService(ExecutionContext::From(script_state))
+-      ->GetInterestCohort(WTF::Bind(
+-          [](ScriptPromiseResolver* resolver, Document* document,
+-             mojom::blink::InterestCohortPtr interest_cohort) {
+-            DCHECK(resolver);
+-            DCHECK(document);
+-
+-            if (interest_cohort->version.IsEmpty()) {
+-              ScriptState* state = resolver->GetScriptState();
+-              ScriptState::Scope scope(state);
+-
+-              resolver->Reject(V8ThrowDOMException::CreateOrEmpty(
+-                  state->GetIsolate(), DOMExceptionCode::kDataError,
+-                  "Failed to get the interest cohort: either it is "
+-                  "unavailable, or preferences or content settings have "
+-                  "denied access."));
+-            } else {
+-              InterestCohort* result = InterestCohort::Create();
+-              result->setId(interest_cohort->id);
+-              result->setVersion(interest_cohort->version);
+-
+-              resolver->Resolve(result);
+-            }
+-          },
+-          WrapPersistent(resolver), WrapPersistent(this)));
+-
+   return promise;
+ }
+ 
+diff --git a/third_party/blink/renderer/core/dom/document.idl b/third_party/blink/renderer/core/dom/document.idl
+--- a/third_party/blink/renderer/core/dom/document.idl
++++ b/third_party/blink/renderer/core/dom/document.idl
+@@ -193,7 +193,6 @@ typedef (HTMLScriptElement or SVGScriptElement) HTMLOrSVGScriptElement;
+ 
+     // Interest Cohort API
+     // TODO(yaoxia): Add web tests. http://crbug/1130074.
+-    [CallWith=ScriptState, RaisesException, NewObject, SecureContext, RuntimeEnabled=InterestCohortAPI, MeasureAs=InterestCohortAPI_interestCohort_Method] Promise<InterestCohort> interestCohort();
+ 
+     // Text fragment directive API
+     // https://wicg.github.io/scroll-to-text-fragment/#feature-detectability
+diff --git a/third_party/blink/renderer/core/dom/interest_cohort.idl b/third_party/blink/renderer/core/dom/interest_cohort.idl
+--- a/third_party/blink/renderer/core/dom/interest_cohort.idl
++++ b/third_party/blink/renderer/core/dom/interest_cohort.idl
+@@ -4,7 +4,3 @@
+ 
+ // https://wicg.github.io/floc/#dictdef-interestcohort
+ 
+-dictionary InterestCohort {
+-  DOMString id;
+-  DOMString version;
+-};
+diff --git a/third_party/blink/renderer/core/permissions_policy/permissions_policy_features.json5 b/third_party/blink/renderer/core/permissions_policy/permissions_policy_features.json5
+--- a/third_party/blink/renderer/core/permissions_policy/permissions_policy_features.json5
++++ b/third_party/blink/renderer/core/permissions_policy/permissions_policy_features.json5
+@@ -240,12 +240,6 @@
+       permissions_policy_name: "idle-detection",
+       depends_on: ["IdleDetection"],
+     },
+-    {
+-      name: "InterestCohort",
+-      permissions_policy_name: "interest-cohort",
+-      feature_default: "EnableForAll",
+-      depends_on: ["InterestCohortFeaturePolicy"],
+-    },
+     {
+       name: "JoinAdInterestGroup",
+       permissions_policy_name: "join-ad-interest-group",
+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
+@@ -1259,12 +1259,11 @@
+     },
+     {
+       name: "InterestCohortAPI",
+-      origin_trial_feature_name: "InterestCohortAPI",
+-      origin_trial_allows_third_party: true,
++      depends_on: ["DisabledForBromite"]
+     },
+     {
+       name: "InterestCohortFeaturePolicy",
+-      status: "experimental",
++      depends_on: ["DisabledForBromite"]
+     },
+     {
+       name: "IntersectionObserverDocumentScrollingElementRoot",
+--
+2.25.1

+ 0 - 54
build/patches/Disable-HEAD-requests-for-single-word-Omnibar-searches.patch

@@ -1,54 +0,0 @@
-From: csagan5 <32685696+csagan5@users.noreply.github.com>
-Date: Sun, 27 Oct 2019 10:21:19 +0100
-Subject: Disable HEAD requests for single-word Omnibar searches
-
-Patch from https://github.com/Eloston/ungoogled-chromium/issues/814#issuecomment-526873727
----
- .../ui/omnibox/chrome_omnibox_navigation_observer.cc      | 8 ++++----
- .../ui/omnibox/chrome_omnibox_navigation_observer.h       | 2 +-
- 2 files changed, 5 insertions(+), 5 deletions(-)
-
-diff --git a/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.cc b/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.cc
---- a/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.cc
-+++ b/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.cc
-@@ -86,8 +86,8 @@ ChromeOmniboxNavigationObserver::ChromeOmniboxNavigationObserver(
-       shortcuts_backend_(ShortcutsBackendFactory::GetForProfile(profile)),
-       load_state_(LOAD_NOT_SEEN),
-       fetch_state_(FETCH_NOT_COMPLETE) {
--  if (alternate_nav_match_.destination_url.is_valid())
--    CreateLoader(alternate_nav_match_.destination_url);
-+//  if (alternate_nav_match_.destination_url.is_valid())
-+//    CreateLoader(alternate_nav_match_.destination_url);
- 
-   // We need to start by listening to AllSources, since we don't know which tab
-   // the navigation might occur in.
-@@ -291,7 +291,7 @@ void ChromeOmniboxNavigationObserver::OnAllLoadingFinished() {
-   delete this;
- }
- 
--void ChromeOmniboxNavigationObserver::CreateLoader(
-+/*void ChromeOmniboxNavigationObserver::CreateLoader(
-     const GURL& destination_url) {
-   net::NetworkTrafficAnnotationTag traffic_annotation =
-       net::DefineNetworkTrafficAnnotation("omnibox_navigation_observer", R"(
-@@ -336,4 +336,4 @@ void ChromeOmniboxNavigationObserver::CreateLoader(
-   loader_->SetAllowHttpErrorResults(true);
-   loader_->SetOnRedirectCallback(base::BindRepeating(
-       &ChromeOmniboxNavigationObserver::OnURLRedirect, base::Unretained(this)));
--}
-+}*/
-diff --git a/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.h b/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.h
---- a/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.h
-+++ b/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.h
-@@ -130,7 +130,7 @@ class ChromeOmniboxNavigationObserver : public OmniboxNavigationObserver,
- 
-   // Creates a URL loader for |destination_url| and stores it in |loader_|.
-   // Does not start the loader.
--  void CreateLoader(const GURL& destination_url);
-+  //void CreateLoader(const GURL& destination_url);
- 
-   const std::u16string text_;
-   const AutocompleteMatch match_;
--- 
-2.20.1
-

+ 2 - 3
build/patches/Disable-NTP-remote-suggestions-by-default.patch

@@ -42,6 +42,5 @@ diff --git a/components/ntp_snippets/features.cc b/components/ntp_snippets/featu
  
  const base::Feature kOptionalImagesEnabledFeature{
      "NTPRemoteSuggestionsOptionalImages", base::FEATURE_ENABLED_BY_DEFAULT};
--- 
-2.20.1
-
+--
+2.25.1

+ 4 - 5
build/patches/Disable-all-promo-dialogs.patch

@@ -9,7 +9,7 @@ Subject: Disable all promo dialogs
 diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java
 --- a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java
 +++ b/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/TabbedRootUiCoordinator.java
-@@ -823,7 +823,7 @@ public class TabbedRootUiCoordinator extends RootUiCoordinator {
+@@ -851,7 +851,7 @@ public class TabbedRootUiCoordinator extends RootUiCoordinator {
       * displayed.
       */
      private boolean triggerPromo(boolean intentWithEffect) {
@@ -18,7 +18,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/Tab
              if (CommandLine.getInstance().hasSwitch(ChromeSwitches.DISABLE_STARTUP_PROMOS)) {
                  return false;
              }
-@@ -858,8 +858,8 @@ public class TabbedRootUiCoordinator extends RootUiCoordinator {
+@@ -886,8 +886,8 @@ public class TabbedRootUiCoordinator extends RootUiCoordinator {
                  preferenceManager.writeBoolean(
                          ChromePreferenceKeys.PROMOS_SKIPPED_ON_FIRST_START, true);
              }
@@ -29,6 +29,5 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tabbed_mode/Tab
      }
  
      private boolean maybeShowPromo() {
--- 
-2.20.1
-
+--
+2.25.1

+ 3 - 4
build/patches/Disable-autofill-assistant-by-default.patch

@@ -9,7 +9,7 @@ Subject: Disable autofill assistant by default
 diff --git a/chrome/android/features/autofill_assistant/public/java/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantPreferencesUtil.java b/chrome/android/features/autofill_assistant/public/java/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantPreferencesUtil.java
 --- a/chrome/android/features/autofill_assistant/public/java/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantPreferencesUtil.java
 +++ b/chrome/android/features/autofill_assistant/public/java/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantPreferencesUtil.java
-@@ -23,7 +23,7 @@ public class AutofillAssistantPreferencesUtil {
+@@ -22,7 +22,7 @@ public class AutofillAssistantPreferencesUtil {
      /** Checks whether the Autofill Assistant switch preference in settings is on. */
      static boolean isAutofillAssistantSwitchOn() {
          return SharedPreferencesManager.getInstance().readBoolean(
@@ -18,6 +18,5 @@ diff --git a/chrome/android/features/autofill_assistant/public/java/src/org/chro
      }
  
      /** Checks whether proactive help is enabled. */
--- 
-2.20.1
-
+--
+2.25.1

+ 347 - 0
build/patches/Disable-conversion-measurement-api.patch

@@ -0,0 +1,347 @@
+From: uazo <uazo@users.noreply.github.com>
+Date: Mon, 15 Nov 2021 09:43:29 +0000
+Subject: Disable conversion measurement api
+
+Disable Conversion Measurement API by disabling the flag and removing
+support for the AttributionReporting provider. it also removes
+the handling of attributions via intents between apps.
+This patch enforces the deactivation by preventing the report from
+being sent and being saved to disk, although it is currently in uncalled code.
+---
+ chrome/android/java/AndroidManifest.xml         |  8 --------
+ .../AttributionIntentHandlerFactory.java        |  9 +--------
+ .../flags/android/chrome_feature_list.cc        |  2 +-
+ .../embedder_support/origin_trials/features.cc  |  3 ++-
+ .../render_view_context_menu_base.cc            |  3 ---
+ .../browser/android/navigation_handle_proxy.cc  | 10 ----------
+ .../attribution_reporting/attribution_host.cc   |  8 --------
+ .../attribution_reporting/attribution_host.h    |  3 ---
+ .../attribution_host_utils.cc                   |  6 ++++++
+ .../attribution_network_sender_impl.cc          | 17 ++++++++++-------
+ .../attribution_storage_sql.cc                  |  2 +-
+ .../navigation_controller_android.cc            | 16 ----------------
+ content/browser/storage_partition_impl.cc       |  7 +------
+ .../browser/AttributionReporterImpl.java        |  4 ----
+ content/public/browser/navigation_controller.cc |  1 -
+ third_party/blink/common/features.cc            |  2 +-
+ .../platform/runtime_enabled_features.json5     | 13 +++++++++----
+ 17 files changed, 32 insertions(+), 82 deletions(-)
+
+diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml
+--- a/chrome/android/java/AndroidManifest.xml
++++ b/chrome/android/java/AndroidManifest.xml
+@@ -1264,14 +1264,6 @@ by a child template that "extends" this file.
+                   android:readPermission="android.permission.GLOBAL_SEARCH" />
+       </provider>
+ 
+-      <!-- Provider for App to Web impression attribution.
+-           TODO(https://crbug.com/1210171): Gate this provider behind a custom permission? -->
+-      <provider android:name="org.chromium.chrome.browser.attribution_reporting.AttributionReportingProvider"
+-          android:authorities="{{ manifest_package }}.AttributionReporting"
+-          android:exported="true"
+-          tools:ignore="ExportedContentProvider">
+-      </provider>
+-
+       {% block base_application_definitions %}
+       {% endblock %}
+       {% block extra_application_definitions_for_test %}
+diff --git a/chrome/browser/attribution_reporting/android/internal/java/src/org/chromium/chrome/browser/attribution_reporting/AttributionIntentHandlerFactory.java b/chrome/browser/attribution_reporting/android/internal/java/src/org/chromium/chrome/browser/attribution_reporting/AttributionIntentHandlerFactory.java
+--- a/chrome/browser/attribution_reporting/android/internal/java/src/org/chromium/chrome/browser/attribution_reporting/AttributionIntentHandlerFactory.java
++++ b/chrome/browser/attribution_reporting/android/internal/java/src/org/chromium/chrome/browser/attribution_reporting/AttributionIntentHandlerFactory.java
+@@ -26,14 +26,7 @@ public class AttributionIntentHandlerFactory {
+      * @return an AttributionIntentHandler instance.
+      */
+     public static AttributionIntentHandler getInstance() {
+-        if (CachedFeatureFlags.isEnabled(ChromeFeatureList.APP_TO_WEB_ATTRIBUTION)) {
+-            if (sIntentHandler == null) {
+-                sIntentHandler = new AttributionIntentHandlerImpl(sValidator);
+-            }
+-            return sIntentHandler;
+-        } else {
+-            return new NoopAttributionIntentHandler();
+-        }
++        return new NoopAttributionIntentHandler();
+     }
+ 
+     public static void setInputEventValidatorForTesting(Predicate<InputEvent> validator) {
+diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc
+--- a/chrome/browser/flags/android/chrome_feature_list.cc
++++ b/chrome/browser/flags/android/chrome_feature_list.cc
+@@ -428,7 +428,7 @@ const base::Feature kAppMenuMobileSiteOption{"AppMenuMobileSiteOption",
+                                              base::FEATURE_DISABLED_BY_DEFAULT};
+ 
+ const base::Feature kAppToWebAttribution{"AppToWebAttribution",
+-                                         base::FEATURE_DISABLED_BY_DEFAULT};
++                                         base::FEATURE_DISABLED_BY_DEFAULT}; // guard this
+ 
+ const base::Feature kBackgroundThreadPool{"BackgroundThreadPool",
+                                           base::FEATURE_DISABLED_BY_DEFAULT};
+diff --git a/components/embedder_support/origin_trials/features.cc b/components/embedder_support/origin_trials/features.cc
+--- a/components/embedder_support/origin_trials/features.cc
++++ b/components/embedder_support/origin_trials/features.cc
+@@ -17,8 +17,9 @@ const base::Feature kOriginTrialsSampleAPIThirdPartyAlternativeUsage{
+     "OriginTrialsSampleAPIThirdPartyAlternativeUsage",
+     base::FEATURE_ENABLED_BY_DEFAULT};
+ 
++// When disabled, the API cannot be enabled by tokens.
+ const base::Feature kConversionMeasurementAPIAlternativeUsage{
+     "ConversionMeasurementAPIAlternativeUsage",
+-    base::FEATURE_ENABLED_BY_DEFAULT};
++    base::FEATURE_DISABLED_BY_DEFAULT};
+ 
+ }  // namespace embedder_support
+diff --git a/components/renderer_context_menu/render_view_context_menu_base.cc b/components/renderer_context_menu/render_view_context_menu_base.cc
+--- a/components/renderer_context_menu/render_view_context_menu_base.cc
++++ b/components/renderer_context_menu/render_view_context_menu_base.cc
+@@ -485,9 +485,6 @@ void RenderViewContextMenuBase::OpenURLWithExtraHeaders(
+ 
+   open_url_params.source_site_instance = site_instance_;
+ 
+-  if (disposition != WindowOpenDisposition::OFF_THE_RECORD)
+-    open_url_params.impression = params_.impression;
+-
+   source_web_contents_->OpenURL(open_url_params);
+ }
+ 
+diff --git a/content/browser/android/navigation_handle_proxy.cc b/content/browser/android/navigation_handle_proxy.cc
+--- a/content/browser/android/navigation_handle_proxy.cc
++++ b/content/browser/android/navigation_handle_proxy.cc
+@@ -30,16 +30,6 @@ NavigationHandleProxy::NavigationHandleProxy(
+   base::android::ScopedJavaLocalRef<jobject> impression_byte_buffer = nullptr;
+ 
+   // Scoped to out-live the java call as this uses a DirectByteBuffer.
+-  std::vector<uint8_t> byte_vector;
+-  if (cpp_navigation_handle_->GetImpression()) {
+-    blink::mojom::ImpressionPtr impression =
+-        AttributionHost::MojoImpressionFromImpression(
+-            *cpp_navigation_handle_->GetImpression());
+-    byte_vector = blink::mojom::Impression::Serialize(&impression);
+-    impression_byte_buffer = base::android::ScopedJavaLocalRef<jobject>(
+-        env, env->NewDirectByteBuffer(byte_vector.data(), byte_vector.size()));
+-    base::android::CheckException(env);
+-  }
+   java_navigation_handle_ = Java_NavigationHandle_Constructor(
+       env, reinterpret_cast<jlong>(this),
+       url::GURLAndroid::FromNativeGURL(env, cpp_navigation_handle_->GetURL()),
+diff --git a/content/browser/attribution_reporting/attribution_host.cc b/content/browser/attribution_reporting/attribution_host.cc
+--- a/content/browser/attribution_reporting/attribution_host.cc
++++ b/content/browser/attribution_reporting/attribution_host.cc
+@@ -420,14 +420,6 @@ void AttributionHost::BindReceiver(
+   conversion_host->receivers_.Bind(rfh, std::move(receiver));
+ }
+ 
+-// static
+-blink::mojom::ImpressionPtr AttributionHost::MojoImpressionFromImpression(
+-    const blink::Impression& impression) {
+-  return blink::mojom::Impression::New(
+-      impression.conversion_destination, impression.reporting_origin,
+-      impression.impression_data, impression.expiry, impression.priority);
+-}
+-
+ // static
+ void AttributionHost::SetReceiverImplForTesting(AttributionHost* impl) {
+   g_receiver_for_testing = impl;
+diff --git a/content/browser/attribution_reporting/attribution_host.h b/content/browser/attribution_reporting/attribution_host.h
+--- a/content/browser/attribution_reporting/attribution_host.h
++++ b/content/browser/attribution_reporting/attribution_host.h
+@@ -58,9 +58,6 @@ class CONTENT_EXPORT AttributionHost
+       const url::Origin& impression_origin,
+       const blink::Impression& impression);
+ 
+-  static blink::mojom::ImpressionPtr MojoImpressionFromImpression(
+-      const blink::Impression& impression) WARN_UNUSED_RESULT;
+-
+   // Overrides the target object to bind |receiver| to in BindReceiver().
+   static void SetReceiverImplForTesting(AttributionHost* impl);
+ 
+diff --git a/content/browser/attribution_reporting/attribution_host_utils.cc b/content/browser/attribution_reporting/attribution_host_utils.cc
+--- a/content/browser/attribution_reporting/attribution_host_utils.cc
++++ b/content/browser/attribution_reporting/attribution_host_utils.cc
+@@ -19,6 +19,8 @@
+ #include "url/gurl.h"
+ #include "url/origin.h"
+ 
++// will change in attribution_host_utils.cc
++
+ namespace content {
+ 
+ namespace attribution_host_utils {
+@@ -81,6 +83,10 @@ absl::optional<blink::Impression> ParseImpressionFromApp(
+   // Java API should have rejected these already.
+   DCHECK(!source_event_id.empty() && !destination.empty());
+ 
++  // no impression from app
++  if ((true))
++    return absl::nullopt;
++
+   blink::Impression impression;
+   if (!base::StringToUint64(source_event_id, &impression.impression_data))
+     return absl::nullopt;
+diff --git a/content/browser/attribution_reporting/attribution_network_sender_impl.cc b/content/browser/attribution_reporting/attribution_network_sender_impl.cc
+--- a/content/browser/attribution_reporting/attribution_network_sender_impl.cc
++++ b/content/browser/attribution_reporting/attribution_network_sender_impl.cc
+@@ -143,13 +143,9 @@ void AttributionNetworkSenderImpl::SendReport(
+ 
+   LogMetricsOnReportSend(report);
+ 
+-  // Unretained is safe because the URLLoader is owned by |this| and will be
+-  // deleted before |this|.
+-  simple_url_loader_ptr->DownloadHeadersOnly(
+-      url_loader_factory_.get(),
+-      base::BindOnce(&AttributionNetworkSenderImpl::OnReportSent,
+-                     base::Unretained(this), std::move(it), std::move(report),
+-                     std::move(sent_callback)));
++  // this code is never called but if it were, nothing would be sent
++  OnReportSent(std::move(it), std::move(report), std::move(sent_callback),
++    nullptr);
+ }
+ 
+ void AttributionNetworkSenderImpl::SetURLLoaderFactoryForTesting(
+@@ -162,6 +158,13 @@ void AttributionNetworkSenderImpl::OnReportSent(
+     AttributionReport report,
+     ReportSentCallback sent_callback,
+     scoped_refptr<net::HttpResponseHeaders> headers) {
++  if ((true)) {
++    std::move(sent_callback)
++      .Run(SentReport(std::move(report),
++                          SentReport::Status::kSent,
++                          /*response_code*/200));
++    return;
++  }
+   network::SimpleURLLoader* loader = it->get();
+ 
+   // Consider a non-200 HTTP code as a non-internal error.
+diff --git a/content/browser/attribution_reporting/attribution_storage_sql.cc b/content/browser/attribution_reporting/attribution_storage_sql.cc
+--- a/content/browser/attribution_reporting/attribution_storage_sql.cc
++++ b/content/browser/attribution_reporting/attribution_storage_sql.cc
+@@ -271,7 +271,7 @@ void AttributionStorageSql::RunInMemoryForTesting() {
+ }
+ 
+ // static
+-bool AttributionStorageSql::g_run_in_memory_ = false;
++bool AttributionStorageSql::g_run_in_memory_ = true;
+ 
+ AttributionStorageSql::AttributionStorageSql(
+     const base::FilePath& path_to_database,
+diff --git a/content/browser/renderer_host/navigation_controller_android.cc b/content/browser/renderer_host/navigation_controller_android.cc
+--- a/content/browser/renderer_host/navigation_controller_android.cc
++++ b/content/browser/renderer_host/navigation_controller_android.cc
+@@ -319,22 +319,6 @@ void NavigationControllerAndroid::LoadUrl(
+   if (input_start != 0)
+     params.input_start = base::TimeTicks::FromUptimeMillis(input_start);
+ 
+-  if (source_package_name) {
+-    DCHECK(!params.initiator_origin);
+-    // At the moment, source package name is only used for attribution.
+-    DCHECK(attribution_source_event_id);
+-    params.initiator_origin = OriginFromAndroidPackageName(
+-        ConvertJavaStringToUTF8(env, source_package_name));
+-
+-    params.impression = attribution_host_utils::ParseImpressionFromApp(
+-        ConvertJavaStringToUTF8(env, attribution_source_event_id),
+-        ConvertJavaStringToUTF8(env, attribution_destination),
+-        attribution_report_to
+-            ? ConvertJavaStringToUTF8(env, attribution_report_to)
+-            : "",
+-        attribution_expiry);
+-  }
+-
+   params.override_user_agent = static_cast<NavigationController::UserAgentOverrideOption>(
+     user_agent_override_option);
+ 
+diff --git a/content/browser/storage_partition_impl.cc b/content/browser/storage_partition_impl.cc
+--- a/content/browser/storage_partition_impl.cc
++++ b/content/browser/storage_partition_impl.cc
+@@ -1305,12 +1305,7 @@ void StoragePartitionImpl::Initialize(
+   bucket_context_ = base::MakeRefCounted<BucketContext>();
+   bucket_context_->Initialize(quota_manager_proxy);
+ 
+-  // The Conversion Measurement API is not available in Incognito mode.
+-  if (!is_in_memory() &&
+-      base::FeatureList::IsEnabled(blink::features::kConversionMeasurement)) {
+-    attribution_manager_ = std::make_unique<AttributionManagerImpl>(
+-        this, path, special_storage_policy_);
+-  }
++  // The Conversion Measurement API is not available in Bromite.
+ 
+   if (base::FeatureList::IsEnabled(blink::features::kInterestGroupStorage)) {
+     interest_group_manager_ = std::make_unique<InterestGroupManager>(
+diff --git a/content/public/android/java/src/org/chromium/content/browser/AttributionReporterImpl.java b/content/public/android/java/src/org/chromium/content/browser/AttributionReporterImpl.java
+--- a/content/public/android/java/src/org/chromium/content/browser/AttributionReporterImpl.java
++++ b/content/public/android/java/src/org/chromium/content/browser/AttributionReporterImpl.java
+@@ -22,8 +22,6 @@ public class AttributionReporterImpl extends AttributionReporter {
+     public void reportAttributionForCurrentNavigation(WebContents webContents,
+             String sourcePackageName, String sourceEventId, String destination, String reportTo,
+             long expiry) {
+-        AttributionReporterImplJni.get().reportAttributionForCurrentNavigation(
+-                webContents, sourcePackageName, sourceEventId, destination, reportTo, expiry);
+     }
+ 
+     /**
+@@ -33,8 +31,6 @@ public class AttributionReporterImpl extends AttributionReporter {
+     public void reportAppImpression(BrowserContextHandle browserContext, String sourcePackageName,
+             String sourceEventId, String destination, String reportTo, long expiry,
+             long eventTime) {
+-        AttributionReporterImplJni.get().reportAppImpression(browserContext, sourcePackageName,
+-                sourceEventId, destination, reportTo, expiry, eventTime);
+     }
+ 
+     @NativeMethods
+diff --git a/content/public/browser/navigation_controller.cc b/content/public/browser/navigation_controller.cc
+--- a/content/public/browser/navigation_controller.cc
++++ b/content/public/browser/navigation_controller.cc
+@@ -36,7 +36,6 @@ NavigationController::LoadURLParams::LoadURLParams(const OpenURLParams& input)
+       blob_url_loader_factory(input.blob_url_loader_factory),
+       href_translate(input.href_translate),
+       reload_type(input.reload_type),
+-      impression(input.impression),
+       is_pdf(input.is_pdf) {
+ #if DCHECK_IS_ON()
+   DCHECK(input.Valid());
+diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/features.cc
+--- a/third_party/blink/common/features.cc
++++ b/third_party/blink/common/features.cc
+@@ -42,7 +42,7 @@ const base::Feature kCSSContainerQueries{"CSSContainerQueries",
+ 
+ // Controls whether the Conversion Measurement API infrastructure is enabled.
+ const base::Feature kConversionMeasurement{"ConversionMeasurement",
+-                                           base::FEATURE_ENABLED_BY_DEFAULT};
++                                           base::FEATURE_DISABLED_BY_DEFAULT};
+ 
+ const base::Feature kGMSCoreEmoji{"GMSCoreEmoji",
+                                   base::FEATURE_ENABLED_BY_DEFAULT};
+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
+@@ -106,6 +106,13 @@
+   },
+ 
+   data: [
++    {
++      // disable by default features by marking as
++      // depends_on: ["DisabledForBromite"]
++      // to work is needed to remove "origin_trial_feature_name"
++      // and "origin_trial_allows_third_party"
++      name: "DisabledForBromite",
++    },
+     {
+       name: "Accelerated2dCanvas",
+       settable_from_internals: true,
+@@ -482,13 +489,11 @@
+     },
+     {
+       name: "ConversionMeasurement",
+-      origin_trial_feature_name: "ConversionMeasurement",
+-      origin_trial_allows_third_party: true,
+-      status: "experimental",
++      depends_on: ["DisabledForBromite"],
+     },
+     {
+       name: "ConversionMeasurementEventSources",
+-      status: "test",
++      depends_on: ["DisabledForBromite"],
+     },
+     {
+       name: "CooperativeScheduling"
+--
+2.25.1

+ 9 - 10
build/patches/Disable-feeds-support-by-default.patch

@@ -3,15 +3,15 @@ Date: Thu, 19 Dec 2019 22:52:53 +0100
 Subject: Disable feeds support by default
 
 ---
- .../chromium/chrome/browser/feed/shared/FeedFeatures.java | 8 +-------
+ .../org/chromium/chrome/browser/feed/FeedFeatures.java    | 8 +-------
  .../chromium/chrome/browser/flags/CachedFeatureFlags.java | 2 +-
  components/feed/feed_feature_list.cc                      | 4 ++--
  3 files changed, 4 insertions(+), 10 deletions(-)
 
-diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/shared/FeedFeatures.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/shared/FeedFeatures.java
---- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/shared/FeedFeatures.java
-+++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/shared/FeedFeatures.java
-@@ -35,13 +35,7 @@ public final class FeedFeatures {
+diff --git a/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/FeedFeatures.java b/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/FeedFeatures.java
+--- a/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/FeedFeatures.java
++++ b/chrome/browser/feed/android/java/src/org/chromium/chrome/browser/feed/FeedFeatures.java
+@@ -43,13 +43,7 @@ public final class FeedFeatures {
       *         the user is signed in and confirms it's not a child profile.
       */
      public static boolean isWebFeedUIEnabled() {
@@ -29,13 +29,13 @@ diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/
 diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java
 --- a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java
 +++ b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java
-@@ -76,7 +76,7 @@ public class CachedFeatureFlags {
+@@ -81,7 +81,7 @@ public class CachedFeatureFlags {
                      .put(ChromeFeatureList.TAB_TO_GTS_ANIMATION, true)
                      .put(ChromeFeatureList.TEST_DEFAULT_DISABLED, false)
                      .put(ChromeFeatureList.TEST_DEFAULT_ENABLED, true)
 -                    .put(ChromeFeatureList.INTEREST_FEED_V2, true)
 +                    .put(ChromeFeatureList.INTEREST_FEED_V2, false)
-                     .put(ChromeFeatureList.THEME_REFACTOR_ANDROID, false)
+                     .put(ChromeFeatureList.THEME_REFACTOR_ANDROID, true)
                      .put(ChromeFeatureList.USE_CHIME_ANDROID_SDK, false)
                      .put(ChromeFeatureList.CCT_INCOGNITO_AVAILABLE_TO_THIRD_PARTY, false)
 diff --git a/components/feed/feed_feature_list.cc b/components/feed/feed_feature_list.cc
@@ -56,6 +56,5 @@ diff --git a/components/feed/feed_feature_list.cc b/components/feed/feed_feature
  
  const base::Feature kInterestFeedV2Autoplay{"InterestFeedV2Autoplay",
                                              base::FEATURE_DISABLED_BY_DEFAULT};
--- 
-2.20.1
-
+--
+2.25.1

+ 184 - 7
build/patches/Disable-fetching-of-all-field-trials.patch

@@ -2,14 +2,191 @@ From: csagan5 <32685696+csagan5@users.noreply.github.com>
 Date: Sun, 8 Jul 2018 18:16:34 +0200
 Subject: Disable fetching of all field trials
 
+Disable seed-based field trials
 ---
- .../variations/service/variations_service.cc       | 14 ++------------
- 1 file changed, 2 insertions(+), 12 deletions(-)
+ android_webview/nonembedded/BUILD.gn          |  2 --
+ .../services/VariationsSeedServer.java        |  2 --
+ .../chrome_metrics_services_manager_client.cc |  2 ++
+ components/ukm/ukm_recorder_impl.cc           |  3 +++
+ .../firstrun/VariationsSeedBridge.java        |  2 +-
+ .../firstrun/VariationsSeedFetcher.java       | 23 ++++---------------
+ .../variations/net/omnibox_http_headers.cc    |  2 +-
+ .../variations/net/variations_http_headers.cc |  3 +++
+ .../service/variations_field_trial_creator.cc |  4 +++-
+ .../variations/service/variations_service.cc  | 15 +++---------
+ 10 files changed, 20 insertions(+), 38 deletions(-)
 
+diff --git a/android_webview/nonembedded/BUILD.gn b/android_webview/nonembedded/BUILD.gn
+--- a/android_webview/nonembedded/BUILD.gn
++++ b/android_webview/nonembedded/BUILD.gn
+@@ -96,7 +96,6 @@ android_library("services_java") {
+   sources = [
+     "java/src/org/chromium/android_webview/services/AwMinidumpUploadJobService.java",
+     "java/src/org/chromium/android_webview/services/AwMinidumpUploaderDelegate.java",
+-    "java/src/org/chromium/android_webview/services/AwVariationsSeedFetcher.java",
+     "java/src/org/chromium/android_webview/services/ComponentUpdaterSafeModeUtils.java",
+     "java/src/org/chromium/android_webview/services/ComponentsProviderPathUtil.java",
+     "java/src/org/chromium/android_webview/services/ComponentsProviderService.java",
+@@ -107,7 +106,6 @@ android_library("services_java") {
+     "java/src/org/chromium/android_webview/services/MetricsUploadService.java",
+     "java/src/org/chromium/android_webview/services/SafeModeContentProvider.java",
+     "java/src/org/chromium/android_webview/services/SafeModeService.java",
+-    "java/src/org/chromium/android_webview/services/VariationsSeedHolder.java",
+     "java/src/org/chromium/android_webview/services/VariationsSeedServer.java",
+   ]
+   deps = [
+diff --git a/android_webview/nonembedded/java/src/org/chromium/android_webview/services/VariationsSeedServer.java b/android_webview/nonembedded/java/src/org/chromium/android_webview/services/VariationsSeedServer.java
+--- a/android_webview/nonembedded/java/src/org/chromium/android_webview/services/VariationsSeedServer.java
++++ b/android_webview/nonembedded/java/src/org/chromium/android_webview/services/VariationsSeedServer.java
+@@ -30,8 +30,6 @@ public class VariationsSeedServer extends Service {
+         @Override
+         public void getSeed(ParcelFileDescriptor newSeedFile, long oldSeedDate,
+                 IVariationsSeedServerCallback callback) {
+-            maybeReportMetrics(callback);
+-            VariationsSeedHolder.getInstance().writeSeedIfNewer(newSeedFile, oldSeedDate);
+         }
+     };
+ 
+diff --git a/chrome/browser/metrics/chrome_metrics_services_manager_client.cc b/chrome/browser/metrics/chrome_metrics_services_manager_client.cc
+--- a/chrome/browser/metrics/chrome_metrics_services_manager_client.cc
++++ b/chrome/browser/metrics/chrome_metrics_services_manager_client.cc
+@@ -189,6 +189,8 @@ ChromeMetricsServicesManagerClient::GetMetricsStateManagerForTesting() {
+ void ChromeMetricsServicesManagerClient::CreateFallbackSamplingTrial(
+     version_info::Channel channel,
+     base::FeatureList* feature_list) {
++  if ((true))
++    return;
+   // The trial name must be kept in sync with the server config controlling
+   // sampling. If they don't match, then clients will be shuffled into different
+   // groups when the server config takes over from the fallback trial.
+diff --git a/components/ukm/ukm_recorder_impl.cc b/components/ukm/ukm_recorder_impl.cc
+--- a/components/ukm/ukm_recorder_impl.cc
++++ b/components/ukm/ukm_recorder_impl.cc
+@@ -179,6 +179,9 @@ UkmRecorderImpl::~UkmRecorderImpl() = default;
+ void UkmRecorderImpl::CreateFallbackSamplingTrial(
+     bool is_stable_channel,
+     base::FeatureList* feature_list) {
++  if ((true))
++    return;
++
+   static const char kSampledGroup_Stable[] = "Sampled_NoSeed_Stable";
+   static const char kSampledGroup_Other[] = "Sampled_NoSeed_Other";
+   const char* sampled_group = kSampledGroup_Other;
+diff --git a/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedBridge.java b/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedBridge.java
+--- a/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedBridge.java
++++ b/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedBridge.java
+@@ -51,7 +51,7 @@ public class VariationsSeedBridge {
+     }
+ 
+     @CalledByNative
+-    private static void clearFirstRunPrefs() {
++    public static void clearFirstRunPrefs() {
+         ContextUtils.getAppSharedPreferences()
+                 .edit()
+                 .remove(VARIATIONS_FIRST_RUN_SEED_BASE64)
+diff --git a/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedFetcher.java b/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedFetcher.java
+--- a/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedFetcher.java
++++ b/components/variations/android/java/src/org/chromium/components/variations/firstrun/VariationsSeedFetcher.java
+@@ -45,7 +45,7 @@ public class VariationsSeedFetcher {
+     }
+ 
+     private static final String VARIATIONS_SERVER_URL =
+-            "https://clientservices.googleapis.com/chrome-variations/seed?osname=";
++            "https://clientservices.9oo91apis.qjz9zk/chrome-variations/seed?osname=";
+ 
+     private static final int READ_TIMEOUT = 3000; // time in ms
+     private static final int REQUEST_TIMEOUT = 1000; // time in ms
+@@ -184,24 +184,9 @@ public class VariationsSeedFetcher {
+         assert !ThreadUtils.runningOnUiThread();
+         // Prevent multiple simultaneous fetches
+         synchronized (sLock) {
+-            SharedPreferences prefs = ContextUtils.getAppSharedPreferences();
+-            // Early return if an attempt has already been made to fetch the seed, even if it
+-            // failed. Only attempt to get the initial Java seed once, since a failure probably
+-            // indicates a network problem that is unlikely to be resolved by a second attempt.
+-            // Note that VariationsSeedBridge.hasNativePref() is a pure Java function, reading an
+-            // Android preference that is set when the seed is fetched by the native code.
+-            if (prefs.getBoolean(VARIATIONS_INITIALIZED_PREF, false)
+-                    || VariationsSeedBridge.hasNativePref()) {
+-                return;
+-            }
++            VariationsSeedBridge.clearFirstRunPrefs();
+ 
+-            SeedFetchInfo fetchInfo =
+-                    downloadContent(VariationsPlatform.ANDROID, restrictMode, milestone, channel);
+-            if (fetchInfo.seedInfo != null) {
+-                SeedInfo info = fetchInfo.seedInfo;
+-                VariationsSeedBridge.setVariationsFirstRunSeed(info.seedData, info.signature,
+-                        info.country, info.date, info.isGzipCompressed);
+-            }
++            SharedPreferences prefs = ContextUtils.getAppSharedPreferences();
+             // VARIATIONS_INITIALIZED_PREF should still be set to true when exceptions occur
+             prefs.edit().putBoolean(VARIATIONS_INITIALIZED_PREF, true).apply();
+         }
+@@ -230,7 +215,7 @@ public class VariationsSeedFetcher {
+      * @param channel the channel parameter to pass to the server via a URL param.
+      * @return the object holds the request result and seed data with its related header fields.
+      */
+-    public SeedFetchInfo downloadContent(@VariationsPlatform int platform, String restrictMode,
++    private SeedFetchInfo downloadContent(@VariationsPlatform int platform, String restrictMode,
+             String milestone, String channel) {
+         SeedFetchInfo fetchInfo = new SeedFetchInfo();
+         HttpURLConnection connection = null;
+diff --git a/components/variations/net/omnibox_http_headers.cc b/components/variations/net/omnibox_http_headers.cc
+--- a/components/variations/net/omnibox_http_headers.cc
++++ b/components/variations/net/omnibox_http_headers.cc
+@@ -21,7 +21,7 @@ const char kOmniboxOnDeviceSuggestionsHeader[] =
+ // Whether to enable reporting the header. Included as a quick escape hatch in
+ // case of crashes.
+ const base::Feature kReportOmniboxOnDeviceSuggestionsHeader{
+-    "ReportOmniboxOnDeviceSuggestionsHeader", base::FEATURE_ENABLED_BY_DEFAULT};
++    "ReportOmniboxOnDeviceSuggestionsHeader", base::FEATURE_DISABLED_BY_DEFAULT};
+ 
+ std::string GetHeaderValue() {
+   const std::string group =
+diff --git a/components/variations/net/variations_http_headers.cc b/components/variations/net/variations_http_headers.cc
+--- a/components/variations/net/variations_http_headers.cc
++++ b/components/variations/net/variations_http_headers.cc
+@@ -238,6 +238,9 @@ class VariationsHeaderHelper {
+   VariationsHeaderHelper& operator=(const VariationsHeaderHelper&) = delete;
+ 
+   bool AppendHeaderIfNeeded(const GURL& url, InIncognito incognito) {
++    if((true))
++      return false;
++
+     AppendOmniboxOnDeviceSuggestionsHeaderIfNeeded(url, resource_request_);
+ 
+     // Note the criteria for attaching client experiment headers:
+diff --git a/components/variations/service/variations_field_trial_creator.cc b/components/variations/service/variations_field_trial_creator.cc
+--- a/components/variations/service/variations_field_trial_creator.cc
++++ b/components/variations/service/variations_field_trial_creator.cc
+@@ -246,8 +246,8 @@ bool VariationsFieldTrialCreator::SetUpFieldTrials(
+   // instance is set.
+   feature_list->RegisterExtraFeatureOverrides(extra_overrides);
+ 
+-  bool used_testing_config = false;
+ #if BUILDFLAG(FIELDTRIAL_TESTING_ENABLED)
++  bool used_testing_config = false;
+   if (!command_line->HasSwitch(switches::kDisableFieldTrialTestingConfig) &&
+       !command_line->HasSwitch(::switches::kForceFieldTrials) &&
+       !command_line->HasSwitch(switches::kVariationsServerURL)) {
+@@ -261,10 +261,12 @@ bool VariationsFieldTrialCreator::SetUpFieldTrials(
+   }
+ #endif  // BUILDFLAG(FIELDTRIAL_TESTING_ENABLED)
+   bool used_seed = false;
++#if defined(FIELDTRIAL_SEED_ENABLED)
+   if (!used_testing_config) {
+     used_seed = CreateTrialsFromSeed(low_entropy_provider.get(),
+                                      feature_list.get(), safe_seed_manager);
+   }
++#endif  // BUILDFLAG(FIELDTRIAL_SEED_ENABLED)
+ 
+   platform_field_trials->SetUpFeatureControllingFieldTrials(
+       used_seed, low_entropy_provider.get(), feature_list.get());
 diff --git a/components/variations/service/variations_service.cc b/components/variations/service/variations_service.cc
 --- a/components/variations/service/variations_service.cc
 +++ b/components/variations/service/variations_service.cc
-@@ -240,17 +240,7 @@ bool GetInstanceManipulations(const net::HttpResponseHeaders* headers,
+@@ -234,17 +234,8 @@ bool GetInstanceManipulations(const net::HttpResponseHeaders* headers,
  // Variations seed fetching is only enabled in official Chrome builds, if a URL
  // is specified on the command line, and for testing.
  bool IsFetchingEnabled() {
@@ -24,11 +201,12 @@ diff --git a/components/variations/service/variations_service.cc b/components/va
 -  }
 -#endif
 -  return true;
++  // set to false even if not used on Android
 +  return false;
  }
  
  std::unique_ptr<SeedResponse> MaybeImportFirstRunSeed(
-@@ -610,7 +600,7 @@ bool VariationsService::DoFetchFromURL(const GURL& url, bool is_http_retry) {
+@@ -602,7 +593,7 @@ bool VariationsService::DoFetchFromURL(const GURL& url, bool is_http_retry) {
    // debugger or if the machine was suspended) and OnURLFetchComplete() hasn't
    // had a chance to run yet from the previous request. In this case, don't
    // start a new request and just let the previous one finish.
@@ -37,6 +215,5 @@ diff --git a/components/variations/service/variations_service.cc b/components/va
      return false;
  
    last_request_was_http_retry_ = is_http_retry;
--- 
-2.20.1
-
+--
+2.25.1

+ 22 - 0
build/patches/Disable-idle-detection.patch

@@ -0,0 +1,22 @@
+From: csagan5 <32685696+csagan5@users.noreply.github.com>
+Date: Sat, 19 Feb 2022 12:01:33 +0100
+Subject: Disable idle detection
+
+---
+ content/public/common/content_features.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc
+--- a/content/public/common/content_features.cc
++++ b/content/public/common/content_features.cc
+@@ -393,7 +393,7 @@ const base::Feature kHistoryPreventSandboxedNavigation{
+ // this feature, the experimental web platform features flag should be set,
+ // or the site should obtain an Origin Trial token.
+ const base::Feature kIdleDetection{"IdleDetection",
+-                                   base::FEATURE_ENABLED_BY_DEFAULT};
++                                   base::FEATURE_DISABLED_BY_DEFAULT};
+ 
+ // Historically most navigations required IPC from browser to renderer and
+ // from renderer back to browser. This was done to check for before-unload
+--
+2.25.1

+ 2 - 3
build/patches/Disable-lock-icon-in-address-bar-by-default.patch

@@ -16,6 +16,5 @@ diff --git a/chrome/browser/ui/toolbar/chrome_location_bar_model_delegate.cc b/c
 -  registry->RegisterBooleanPref(omnibox::kLockIconInAddressBarEnabled, false);
 +  registry->RegisterBooleanPref(omnibox::kLockIconInAddressBarEnabled, true);
  }
--- 
-2.20.1
-
+--
+2.25.1

+ 7 - 8
build/patches/Disable-media-router-and-remoting-by-default.patch

@@ -11,8 +11,8 @@ Subject: Disable media router and remoting by default
 diff --git a/chrome/browser/media/router/media_router_feature.cc b/chrome/browser/media/router/media_router_feature.cc
 --- a/chrome/browser/media/router/media_router_feature.cc
 +++ b/chrome/browser/media/router/media_router_feature.cc
-@@ -37,26 +37,15 @@ const base::Feature kAllowAllSitesToInitiateMirroring{
-     "AllowAllSitesToInitiateMirroring", base::FEATURE_DISABLED_BY_DEFAULT};
+@@ -41,26 +41,15 @@ const base::Feature kDialEnforceUrlIPAddress{"DialEnforceUrlIPAddress",
+                                              base::FEATURE_DISABLED_BY_DEFAULT};
  #endif  // !defined(OS_ANDROID)
  
 -namespace {
@@ -44,7 +44,7 @@ diff --git a/chrome/browser/media/router/media_router_feature.cc b/chrome/browse
  #if !defined(OS_ANDROID)
    if (!base::FeatureList::IsEnabled(kMediaRouter))
      return false;
-@@ -80,7 +69,7 @@ bool MediaRouterEnabled(content::BrowserContext* context) {
+@@ -84,7 +73,7 @@ bool MediaRouterEnabled(content::BrowserContext* context) {
      return allowed;
    }
    return true;
@@ -56,7 +56,7 @@ diff --git a/chrome/browser/media/router/media_router_feature.cc b/chrome/browse
 diff --git a/chrome/browser/profiles/profile.cc b/chrome/browser/profiles/profile.cc
 --- a/chrome/browser/profiles/profile.cc
 +++ b/chrome/browser/profiles/profile.cc
-@@ -365,7 +365,7 @@ void Profile::RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
+@@ -359,7 +359,7 @@ void Profile::RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
        media_router::prefs::kMediaRouterEnableCloudServices, false,
        user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
    registry->RegisterBooleanPref(
@@ -68,7 +68,7 @@ diff --git a/chrome/browser/profiles/profile.cc b/chrome/browser/profiles/profil
 diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/profile_impl.cc
 --- a/chrome/browser/profiles/profile_impl.cc
 +++ b/chrome/browser/profiles/profile_impl.cc
-@@ -445,7 +445,7 @@ void ProfileImpl::RegisterProfilePrefs(
+@@ -415,7 +415,7 @@ void ProfileImpl::RegisterProfilePrefs(
  #endif
  
    registry->RegisterBooleanPref(prefs::kForceEphemeralProfiles, false);
@@ -77,6 +77,5 @@ diff --git a/chrome/browser/profiles/profile_impl.cc b/chrome/browser/profiles/p
  #if !defined(OS_ANDROID)
    registry->RegisterBooleanPref(prefs::kShowCastIconInToolbar, false);
  #endif  // !defined(OS_ANDROID)
--- 
-2.20.1
-
+--
+2.25.1

+ 34 - 22
build/patches/Disable-metrics-collection-for-NTP-tiles.patch

@@ -3,14 +3,15 @@ Date: Wed, 20 Feb 2019 21:41:26 +0100
 Subject: Disable metrics collection for NTP tiles
 
 ---
- .../browser/android/ntp/most_visited_sites_bridge.cc   | 10 ++--------
- components/ntp_tiles/BUILD.gn                          |  3 ---
- 2 files changed, 2 insertions(+), 11 deletions(-)
+ .../android/ntp/most_visited_sites_bridge.cc    | 17 -----------------
+ components/ntp_tiles/BUILD.gn                   |  3 ---
+ components/ntp_tiles/most_visited_sites.cc      |  2 --
+ 3 files changed, 22 deletions(-)
 
 diff --git a/chrome/browser/android/ntp/most_visited_sites_bridge.cc b/chrome/browser/android/ntp/most_visited_sites_bridge.cc
 --- a/chrome/browser/android/ntp/most_visited_sites_bridge.cc
 +++ b/chrome/browser/android/ntp/most_visited_sites_bridge.cc
-@@ -25,7 +25,6 @@
+@@ -26,7 +26,6 @@
  #include "chrome/browser/profiles/profile_android.h"
  #include "components/favicon_base/favicon_types.h"
  #include "components/history/core/browser/history_service.h"
@@ -18,7 +19,7 @@ diff --git a/chrome/browser/android/ntp/most_visited_sites_bridge.cc b/chrome/br
  #include "components/ntp_tiles/most_visited_sites.h"
  #include "components/ntp_tiles/section_type.h"
  #include "ui/gfx/android/java_bitmap.h"
-@@ -45,7 +44,6 @@ using ntp_tiles::NTPTilesVector;
+@@ -46,7 +45,6 @@ using ntp_tiles::NTPTilesVector;
  using ntp_tiles::SectionType;
  using ntp_tiles::TileTitleSource;
  using ntp_tiles::TileSource;
@@ -26,7 +27,7 @@ diff --git a/chrome/browser/android/ntp/most_visited_sites_bridge.cc b/chrome/br
  
  namespace {
  
-@@ -230,7 +228,6 @@ void MostVisitedSitesBridge::RecordPageImpression(
+@@ -233,7 +231,6 @@ void MostVisitedSitesBridge::RecordPageImpression(
      JNIEnv* env,
      const JavaParamRef<jobject>& obj,
      jint jtiles_count) {
@@ -34,23 +35,23 @@ diff --git a/chrome/browser/android/ntp/most_visited_sites_bridge.cc b/chrome/br
  }
  
  void MostVisitedSitesBridge::RecordTileImpression(
-@@ -242,6 +239,7 @@ void MostVisitedSitesBridge::RecordTileImpression(
+@@ -245,15 +242,6 @@ void MostVisitedSitesBridge::RecordTileImpression(
      jint jtitle_source,
      jint jsource,
      const JavaParamRef<jobject>& jurl) {
-+#if 0
-   std::unique_ptr<GURL> url = url::GURLAndroid::ToNativeGURL(env, jurl);
-   TileTitleSource title_source = static_cast<TileTitleSource>(jtitle_source);
-   TileSource source = static_cast<TileSource>(jsource);
-@@ -251,6 +249,7 @@ void MostVisitedSitesBridge::RecordTileImpression(
- 
-   ntp_tiles::metrics::RecordTileImpression(ntp_tiles::NTPTileImpression(
-       jindex, source, title_source, visual_type, icon_type, *url));
-+#endif
+-  std::unique_ptr<GURL> url = url::GURLAndroid::ToNativeGURL(env, jurl);
+-  TileTitleSource title_source = static_cast<TileTitleSource>(jtitle_source);
+-  TileSource source = static_cast<TileSource>(jsource);
+-  TileVisualType visual_type = static_cast<TileVisualType>(jvisual_type);
+-  favicon_base::IconType icon_type =
+-      static_cast<favicon_base::IconType>(jicon_type);
+-
+-  ntp_tiles::metrics::RecordTileImpression(ntp_tiles::NTPTileImpression(
+-      jindex, source, title_source, visual_type, icon_type, *url));
  }
  
  void MostVisitedSitesBridge::RecordOpenedMostVisitedItem(
-@@ -260,11 +259,6 @@ void MostVisitedSitesBridge::RecordOpenedMostVisitedItem(
+@@ -263,11 +251,6 @@ void MostVisitedSitesBridge::RecordOpenedMostVisitedItem(
      jint tile_type,
      jint title_source,
      jint source) {
@@ -65,7 +66,7 @@ diff --git a/chrome/browser/android/ntp/most_visited_sites_bridge.cc b/chrome/br
 diff --git a/components/ntp_tiles/BUILD.gn b/components/ntp_tiles/BUILD.gn
 --- a/components/ntp_tiles/BUILD.gn
 +++ b/components/ntp_tiles/BUILD.gn
-@@ -20,8 +20,6 @@ static_library("ntp_tiles") {
+@@ -21,8 +21,6 @@ static_library("ntp_tiles") {
      "icon_cacher.h",
      "icon_cacher_impl.cc",
      "icon_cacher_impl.h",
@@ -74,7 +75,7 @@ diff --git a/components/ntp_tiles/BUILD.gn b/components/ntp_tiles/BUILD.gn
      "most_visited_sites.cc",
      "most_visited_sites.h",
      "ntp_tile.cc",
-@@ -83,7 +81,6 @@ source_set("unit_tests") {
+@@ -86,7 +84,6 @@ source_set("unit_tests") {
      "custom_links_manager_impl_unittest.cc",
      "custom_links_store_unittest.cc",
      "icon_cacher_impl_unittest.cc",
@@ -82,6 +83,17 @@ diff --git a/components/ntp_tiles/BUILD.gn b/components/ntp_tiles/BUILD.gn
      "most_visited_sites_unittest.cc",
      "popular_sites_impl_unittest.cc",
    ]
--- 
-2.20.1
-
+diff --git a/components/ntp_tiles/most_visited_sites.cc b/components/ntp_tiles/most_visited_sites.cc
+--- a/components/ntp_tiles/most_visited_sites.cc
++++ b/components/ntp_tiles/most_visited_sites.cc
+@@ -724,8 +724,6 @@ void MostVisitedSites::SaveTilesAndNotify(
+                                    : new_tiles;
+ 
+   if (fixed_tiles.size() != new_tiles.size()) {
+-    metrics::RecordsMigratedDefaultAppDeleted(
+-        DeletedTileType::kMostVisitedSite);
+   }
+   if (!current_tiles_.has_value() || (*current_tiles_ != fixed_tiles)) {
+     current_tiles_.emplace(std::move(fixed_tiles));
+--
+2.25.1

+ 3 - 4
build/patches/Disable-metrics-on-all-I-O-threads.patch

@@ -9,7 +9,7 @@ Subject: Disable metrics on all I/O threads
 diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
 --- a/chrome/browser/browser_process_impl.cc
 +++ b/chrome/browser/browser_process_impl.cc
-@@ -982,7 +982,7 @@ void BrowserProcessImpl::RegisterPrefs(PrefRegistrySimple* registry) {
+@@ -980,7 +980,7 @@ void BrowserProcessImpl::RegisterPrefs(PrefRegistrySimple* registry) {
  #endif  // BUILDFLAG(IS_CHROMEOS_ASH)
  
    registry->RegisterBooleanPref(metrics::prefs::kMetricsReportingEnabled,
@@ -18,6 +18,5 @@ diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_pro
    registry->RegisterBooleanPref(prefs::kDevToolsRemoteDebuggingAllowed, true);
  }
  
--- 
-2.20.1
-
+--
+2.25.1

+ 3 - 5
build/patches/Disable-offline-pages-in-the-downloads-home-to-be-opened-in-CCT-by-default.patch → build/patches/Disable-offline-pages-in-CCT.patch

@@ -1,7 +1,6 @@
 From: csagan5 <32685696+csagan5@users.noreply.github.com>
 Date: Thu, 30 May 2019 03:37:45 +0200
-Subject: Disable offline pages in the downloads home to be opened in CCT by
- default
+Subject: Disable offline pages in CCT
 
 ---
  components/offline_pages/core/offline_page_feature.cc | 2 +-
@@ -19,6 +18,5 @@ diff --git a/components/offline_pages/core/offline_page_feature.cc b/components/
  
  const base::Feature kOfflineIndicatorFeature{"OfflineIndicator",
                                               base::FEATURE_DISABLED_BY_DEFAULT};
--- 
-2.20.1
-
+--
+2.25.1

+ 3 - 4
build/patches/Disable-omission-of-URL-elements-in-Omnibox.patch

@@ -23,7 +23,7 @@ diff --git a/chrome/browser/ui/toolbar/chrome_location_bar_model_delegate.cc b/c
 diff --git a/components/url_formatter/url_formatter.cc b/components/url_formatter/url_formatter.cc
 --- a/components/url_formatter/url_formatter.cc
 +++ b/components/url_formatter/url_formatter.cc
-@@ -463,13 +463,13 @@ ComponentResult IDNToUnicodeOneComponent(
+@@ -467,13 +467,13 @@ ComponentResult IDNToUnicodeOneComponent(
  }  // namespace
  
  const FormatUrlType kFormatUrlOmitNothing = 0;
@@ -44,6 +44,5 @@ diff --git a/components/url_formatter/url_formatter.cc b/components/url_formatte
  const FormatUrlType kFormatUrlOmitMailToScheme = 1 << 8;
  
  const FormatUrlType kFormatUrlOmitDefaults =
--- 
-2.20.1
-
+--
+2.25.1

+ 3 - 4
build/patches/Disable-plugins-enumeration.patch

@@ -9,7 +9,7 @@ Subject: Disable plugins enumeration
 diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc
 --- a/third_party/blink/renderer/core/frame/local_frame.cc
 +++ b/third_party/blink/renderer/core/frame/local_frame.cc
-@@ -1851,10 +1851,8 @@ WebContentSettingsClient* LocalFrame::GetContentSettingsClient() {
+@@ -1855,10 +1855,8 @@ WebContentSettingsClient* LocalFrame::GetContentSettingsClient() {
  }
  
  PluginData* LocalFrame::GetPluginData() const {
@@ -22,6 +22,5 @@ diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/
  }
  
  void LocalFrame::SetAdTrackerForTesting(AdTracker* ad_tracker) {
--- 
-2.20.1
-
+--
+2.25.1

+ 147 - 0
build/patches/Disable-privacy-sandbox.patch

@@ -0,0 +1,147 @@
+From: uazo <uazo@users.noreply.github.com>
+Date: Sat, 13 Nov 2021 09:17:06 +0000
+Subject: Disable privacy sandbox
+
+Remove the ui from the settings and set the flags to inactive
+---
+ .../java/res/xml/privacy_preferences.xml      |  4 ---
+ .../privacy/settings/PrivacySettings.java     | 19 -----------
+ .../privacy_sandbox_settings.cc               | 34 +++++++++----------
+ 3 files changed, 16 insertions(+), 41 deletions(-)
+
+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
+@@ -75,10 +75,6 @@
+         android:title="@string/open_external_links_incognito_title"
+         android:summary="@string/open_external_links_incognito_summary"
+         android:defaultValue="false" />
+-    <Preference
+-        android:key="privacy_sandbox"
+-        android:title="@string/prefs_privacy_sandbox"
+-        android:fragment="org.chromium.chrome.browser.privacy_sandbox.PrivacySandboxSettingsFragment"/>
+ 
+     <PreferenceCategory
+         android:key="services_category"
+diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
+--- a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
++++ b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
+@@ -72,7 +72,6 @@ public class PrivacySettings
+     private static final String PREF_SECURE_DNS = "secure_dns";
+     private static final String PREF_DO_NOT_TRACK = "do_not_track";
+     private static final String PREF_CLEAR_BROWSING_DATA = "clear_browsing_data";
+-    private static final String PREF_PRIVACY_SANDBOX = "privacy_sandbox";
+     private static final String PREF_PRIVACY_REVIEW = "privacy_review";
+     private static final String PREF_INCOGNITO_LOCK = "incognito_lock";
+ 
+@@ -104,18 +103,6 @@ public class PrivacySettings
+         SettingsUtils.addPreferencesFromResource(this, R.xml.privacy_preferences);
+         getActivity().setTitle(R.string.prefs_privacy_security);
+ 
+-        findPreference(PREF_PRIVACY_SANDBOX)
+-                .setSummary(PrivacySandboxSettingsFragment.getStatusString(getContext()));
+-        // Overwrite the click listener to pass a correct referrer to the fragment.
+-        findPreference(PREF_PRIVACY_SANDBOX).setOnPreferenceClickListener(preference -> {
+-            Bundle fragmentArgs = new Bundle();
+-            fragmentArgs.putInt(PrivacySandboxSettingsFragment.PRIVACY_SANDBOX_REFERRER,
+-                    PrivacySandboxReferrer.PRIVACY_SETTINGS);
+-            new SettingsLauncherImpl().launchSettingsActivity(
+-                    getContext(), PrivacySandboxSettingsFragment.class, fragmentArgs);
+-            return true;
+-        });
+-
+         Preference privacyReviewPreference = findPreference(PREF_PRIVACY_REVIEW);
+         if (!ChromeFeatureList.isEnabled(ChromeFeatureList.PRIVACY_REVIEW)) {
+             getPreferenceScreen().removePreference(privacyReviewPreference);
+@@ -296,17 +283,11 @@ public class PrivacySettings
+             secureDnsPref.setSummary(SecureDnsSettings.getSummary(getContext()));
+         }
+ 
+-        Preference privacySandboxPreference = findPreference(PREF_PRIVACY_SANDBOX);
+-        if (privacySandboxPreference != null) {
+         ChromeSwitchPreference forceNoJit =
+                 (ChromeSwitchPreference) findPreference(PREF_FORCE_NO_JIT);
+         forceNoJit.setOnPreferenceChangeListener(this);
+         forceNoJit.setManagedPreferenceDelegate(mManagedPreferenceDelegate);
+ 
+-            privacySandboxPreference.setSummary(
+-                    PrivacySandboxSettingsFragment.getStatusString(getContext()));
+-        }
+-
+         ChromeSwitchPreference historyInIncognitoPref =
+                 (ChromeSwitchPreference) findPreference(PREF_INCOGNITO_TAB_HISTORY_ENABLED);
+         if (historyInIncognitoPref != null) {
+diff --git a/chrome/browser/privacy_sandbox/privacy_sandbox_settings.cc b/chrome/browser/privacy_sandbox/privacy_sandbox_settings.cc
+--- a/chrome/browser/privacy_sandbox/privacy_sandbox_settings.cc
++++ b/chrome/browser/privacy_sandbox/privacy_sandbox_settings.cc
+@@ -111,23 +111,8 @@ bool ThirdPartyCookiesDisabledByPolicy(
+ bool ShouldDisablePrivacySandbox(
+     content_settings::CookieSettings* cookie_settings,
+     PrefService* prefs) {
+-  // If a user has already expressed control over the Privacy Sandbox preference
+-  // on any of their devices there is no need to disable it.
+-  if (prefs->GetBoolean(prefs::kPrivacySandboxManuallyControlled))
+-    return false;
+-
+-  auto cookie_controls_mode_value =
+-      static_cast<content_settings::CookieControlsMode>(
+-          prefs->GetInteger(prefs::kCookieControlsMode));
+-
+-  auto default_cookie_setting =
+-      cookie_settings->GetDefaultCookieSetting(/*provider_id=*/nullptr);
+-
+-  // The Privacy Sandbox preference should be disabled if 3P cookies or all
+-  // cookies are blocked.
+-  return (cookie_controls_mode_value ==
+-              content_settings::CookieControlsMode::kBlockThirdParty ||
+-          default_cookie_setting == ContentSetting::CONTENT_SETTING_BLOCK);
++  // privacy sandbox is always disabled
++  return true;
+ }
+ 
+ // Returns whether FLoC is allowable by the current state of |pref_service|.
+@@ -194,6 +179,8 @@ PrivacySandboxSettings::PrivacySandboxSettings(
+       base::BindRepeating(&PrivacySandboxSettings::OnPrivacySandboxPrefChanged,
+                           base::Unretained(this)));
+ 
++  // as default, privacy sandbox is disabled
++  pref_service_->SetBoolean(prefs::kPrivacySandboxApisEnabled, false);
+   // On first entering the privacy sandbox experiment, users may have the
+   // privacy sandbox disabled (or "reconciled") based on their current cookie
+   // settings (e.g. blocking 3P cookies). Depending on the state of the sync
+@@ -383,7 +370,8 @@ bool PrivacySandboxSettings::IsPrivacySandboxManaged() {
+ 
+ void PrivacySandboxSettings::SetPrivacySandboxEnabled(bool enabled) {
+   pref_service_->SetBoolean(prefs::kPrivacySandboxManuallyControlled, true);
+-  pref_service_->SetBoolean(prefs::kPrivacySandboxApisEnabled, enabled);
++  // never enable privacy sandbox
++  pref_service_->SetBoolean(prefs::kPrivacySandboxApisEnabled, false);
+ }
+ 
+ void PrivacySandboxSettings::OnCookiesCleared() {
+@@ -437,6 +425,10 @@ bool PrivacySandboxSettings::IsPrivacySandboxAllowedForContext(
+     const GURL& url,
+     const absl::optional<url::Origin>& top_frame_origin,
+     const ContentSettingsForOneType& cookie_settings) const {
++  // even if prefs::kPrivacySandboxApisEnabled and
++  // prefs::kPrivacySandboxFlocEnabled are always false
++  if ((true))
++    return false; // guard this code path
+   if (!pref_service_->GetBoolean(prefs::kPrivacySandboxApisEnabled))
+     return false;
+ 
+@@ -449,6 +441,12 @@ bool PrivacySandboxSettings::IsPrivacySandboxAllowedForContext(
+ }
+ 
+ void PrivacySandboxSettings::MaybeReconcilePrivacySandboxPref() {
++  // this code could be eliminated in the future, as initially
++  // the feauture was tied to the cookies flag
++  pref_service_->SetBoolean(prefs::kPrivacySandboxApisEnabled, false);
++  if((true))
++    return;
++
+   // No need to reconcile preferences if it has already happened.
+   if (pref_service_->GetBoolean(prefs::kPrivacySandboxPreferencesReconciled)) {
+     LogPrivacySandboxState();
+--
+2.25.1

+ 3 - 4
build/patches/Disable-references-to-fonts.googleapis.com.patch

@@ -12,7 +12,7 @@ Subject: Disable references to fonts.googleapis.com
 diff --git a/components/dom_distiller/content/browser/dom_distiller_viewer_source.cc b/components/dom_distiller/content/browser/dom_distiller_viewer_source.cc
 --- a/components/dom_distiller/content/browser/dom_distiller_viewer_source.cc
 +++ b/components/dom_distiller/content/browser/dom_distiller_viewer_source.cc
-@@ -300,7 +300,7 @@ bool DomDistillerViewerSource::ShouldServiceRequest(
+@@ -298,7 +298,7 @@ bool DomDistillerViewerSource::ShouldServiceRequest(
  std::string DomDistillerViewerSource::GetContentSecurityPolicy(
      network::mojom::CSPDirectiveName directive) {
    if (directive == network::mojom::CSPDirectiveName::StyleSrc) {
@@ -58,6 +58,5 @@ diff --git a/third_party/crashpad/crashpad/doc/support/crashpad_doxygen.css b/th
  
  body,
  table,
--- 
-2.20.1
-
+--
+2.25.1

+ 28 - 0
build/patches/Disable-requests-for-single-word-Omnibar-searches.patch

@@ -0,0 +1,28 @@
+From: csagan5 <32685696+csagan5@users.noreply.github.com>
+Date: Sun, 27 Oct 2019 10:21:19 +0100
+Subject: Disable requests for single-word Omnibar searches
+
+Patch from https://github.com/Eloston/ungoogled-chromium/issues/814#issuecomment-526873727
+---
+ .../ui/omnibox/chrome_omnibox_navigation_observer.cc       | 7 -------
+ 1 file changed, 7 deletions(-)
+
+diff --git a/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.cc b/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.cc
+--- a/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.cc
++++ b/chrome/browser/ui/omnibox/chrome_omnibox_navigation_observer.cc
+@@ -251,13 +251,6 @@ ChromeOmniboxNavigationObserver::ChromeOmniboxNavigationObserver(
+       profile_(profile),
+       show_infobar_(std::move(show_infobar)) {
+   NavigationUserData::CreateForNavigationHandle(navigation, this);
+-  if (alternative_nav_match_.destination_url.is_valid()) {
+-    loader_ = std::make_unique<AlternativeNavigationURLLoader>(
+-        alternative_nav_match.destination_url, this,
+-        base::BindOnce(
+-            &ChromeOmniboxNavigationObserver::OnAlternativeLoaderDone, this),
+-        GetURLLoaderFactory(loader_factory, profile));
+-  }
+ }
+ 
+ ChromeOmniboxNavigationObserver::~ChromeOmniboxNavigationObserver() {
+--
+2.25.1

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 194 - 171
build/patches/Disable-safe-browsing.patch


+ 0 - 23
build/patches/Disable-search-engine-DSE-automatic-permission.patch

@@ -1,23 +0,0 @@
-From: csagan5 <32685696+csagan5@users.noreply.github.com>
-Date: Thu, 19 Aug 2021 23:11:16 +0200
-Subject: Disable search engine DSE automatic permission
-
----
- components/permissions/features.cc | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/components/permissions/features.cc b/components/permissions/features.cc
---- a/components/permissions/features.cc
-+++ b/components/permissions/features.cc
-@@ -76,7 +76,7 @@ const base::Feature kRevisedOriginHandling{"PermissionsRevisedOriginHandling",
- // When enabled, the Default Search Engine does not automatically receive the
- // "geolocation" and "notifications" permissions. DSE only applies to Android.
- const base::Feature kRevertDSEAutomaticPermissions{
--    "RevertDSEAutomaticPermissions", base::FEATURE_DISABLED_BY_DEFAULT};
-+    "RevertDSEAutomaticPermissions", base::FEATURE_ENABLED_BY_DEFAULT};
- #endif  // defined(OS_ANDROID)
- 
- }  // namespace features
--- 
-2.20.1
-

+ 0 - 37
build/patches/Disable-seed-based-field-trials.patch

@@ -1,37 +0,0 @@
-From: Daniel Micay <danielmicay@gmail.com>
-Date: Tue, 25 Dec 2018 16:19:51 -0500
-Subject: Disable seed-based field trials
-
----
- .../variations/service/variations_field_trial_creator.cc      | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
-diff --git a/components/variations/service/variations_field_trial_creator.cc b/components/variations/service/variations_field_trial_creator.cc
---- a/components/variations/service/variations_field_trial_creator.cc
-+++ b/components/variations/service/variations_field_trial_creator.cc
-@@ -263,8 +263,8 @@ bool VariationsFieldTrialCreator::SetupFieldTrials(
-   // instance is set.
-   feature_list->RegisterExtraFeatureOverrides(extra_overrides);
- 
--  bool used_testing_config = false;
- #if BUILDFLAG(FIELDTRIAL_TESTING_ENABLED)
-+  bool used_testing_config = false;
-   if (!command_line->HasSwitch(switches::kDisableFieldTrialTestingConfig) &&
-       !command_line->HasSwitch(::switches::kForceFieldTrials) &&
-       !command_line->HasSwitch(switches::kVariationsServerURL)) {
-@@ -278,10 +278,12 @@ bool VariationsFieldTrialCreator::SetupFieldTrials(
-   }
- #endif  // BUILDFLAG(FIELDTRIAL_TESTING_ENABLED)
-   bool used_seed = false;
-+#if defined(FIELDTRIAL_SEED_ENABLED)
-   if (!used_testing_config) {
-     used_seed = CreateTrialsFromSeed(low_entropy_provider.get(),
-                                      feature_list.get(), safe_seed_manager);
-   }
-+#endif  // BUILDFLAG(FIELDTRIAL_SEED_ENABLED)
- 
-   platform_field_trials->SetupFeatureControllingFieldTrials(
-       used_seed, low_entropy_provider.get(), feature_list.get());
--- 
-2.20.1
-

+ 18 - 19
build/patches/Disable-smart-selection-by-default.patch

@@ -27,10 +27,10 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearc
  import androidx.annotation.VisibleForTesting;
  
 +import org.chromium.chrome.browser.flags.ChromeFeatureList;
+ import org.chromium.content_public.browser.SelectAroundCaretResult;
  import org.chromium.content_public.browser.SelectionClient;
  import org.chromium.content_public.browser.SelectionEventProcessor;
- import org.chromium.content_public.browser.SelectionPopupController;
-@@ -44,7 +45,8 @@ public class SelectionClientManager {
+@@ -45,7 +46,8 @@ public class SelectionClientManager {
       * @param webContents The {@link WebContents} that will show popups for this client.
       */
      SelectionClientManager(WebContents webContents) {
@@ -43,17 +43,17 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextualsearc
 diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc
 --- a/chrome/browser/flags/android/chrome_feature_list.cc
 +++ b/chrome/browser/flags/android/chrome_feature_list.cc
-@@ -173,6 +173,7 @@ const base::Feature* const kFeaturesExposedToJava[] = {
+@@ -174,6 +174,7 @@ const base::Feature* const kFeaturesExposedToJava[] = {
      &kCCTClientDataHeader,
      &kCCTExternalLinkHandling,
      &kCCTIncognito,
 +    &kChromeSmartSelection,
      &kCCTIncognitoAvailableToThirdParty,
+     &kCCTNewDownloadTab,
      &kCCTPostMessageAPI,
-     &kCCTRedirectPreconnect,
-@@ -487,6 +488,9 @@ const base::Feature kChromeSharingHub{"ChromeSharingHub",
+@@ -501,6 +502,9 @@ const base::Feature kChromeSharingHubLaunchAdjacent{
  const base::Feature kChromeSurveyNextAndroid{"ChromeSurveyNextAndroid",
-                                              base::FEATURE_DISABLED_BY_DEFAULT};
+                                              base::FEATURE_ENABLED_BY_DEFAULT};
  
 +const base::Feature kChromeSmartSelection{"ChromeSmartSelection",
 +                                          base::FEATURE_DISABLED_BY_DEFAULT};
@@ -64,29 +64,29 @@ diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browse
 diff --git a/chrome/browser/flags/android/chrome_feature_list.h b/chrome/browser/flags/android/chrome_feature_list.h
 --- a/chrome/browser/flags/android/chrome_feature_list.h
 +++ b/chrome/browser/flags/android/chrome_feature_list.h
-@@ -49,6 +49,7 @@ extern const base::Feature kDontAutoHideBrowserControls;
+@@ -50,6 +50,7 @@ extern const base::Feature kCCTResourcePrefetch;
+ extern const base::Feature kDontAutoHideBrowserControls;
  extern const base::Feature kChromeShareLongScreenshot;
  extern const base::Feature kChromeShareScreenshot;
- extern const base::Feature kChromeSharingHub;
 +extern const base::Feature kChromeSmartSelection;
+ extern const base::Feature kChromeSharingHub;
+ extern const base::Feature kChromeSharingHubLaunchAdjacent;
  extern const base::Feature kChromeSurveyNextAndroid;
- extern const base::Feature kCommandLineOnNonRooted;
- extern const base::Feature kConditionalTabStripAndroid;
 diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
 --- a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
 +++ b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
-@@ -255,6 +255,7 @@ public abstract class ChromeFeatureList {
-     public static final String CCT_EXTERNAL_LINK_HANDLING = "CCTExternalLinkHandling";
+@@ -241,6 +241,7 @@ public abstract class ChromeFeatureList {
+     public static final String CCT_NEW_DOWNLOAD_TAB = "CCTNewDownloadTab";
      public static final String CCT_POST_MESSAGE_API = "CCTPostMessageAPI";
      public static final String CCT_REDIRECT_PRECONNECT = "CCTRedirectPreconnect";
 +    public static final String CHROME_SMART_SELECTION = "ChromeSmartSelection";
      public static final String CCT_REMOVE_REMOTE_VIEW_IDS = "CCTRemoveRemoteViewIds";
-     public static final String CCT_RESIZABLE_FOR_FIRST_PARTIES = "CCTResizableForFirstParties";
-     public static final String CCT_RESIZABLE_FOR_THIRD_PARTIES = "CCTResizableForThirdParties";
+     public static final String CCT_RESIZABLE_90_MAXIMUM_HEIGHT = "CCTResizable90MaximumHeight";
+     public static final String CCT_RESIZABLE_ALLOW_RESIZE_BY_USER_GESTURE =
 diff --git a/content/public/android/java/src/org/chromium/content/browser/selection/SelectionPopupControllerImpl.java b/content/public/android/java/src/org/chromium/content/browser/selection/SelectionPopupControllerImpl.java
 --- a/content/public/android/java/src/org/chromium/content/browser/selection/SelectionPopupControllerImpl.java
 +++ b/content/public/android/java/src/org/chromium/content/browser/selection/SelectionPopupControllerImpl.java
-@@ -839,7 +839,7 @@ public class SelectionPopupControllerImpl extends ActionModeCallbackHelper
+@@ -840,7 +840,7 @@ public class SelectionPopupControllerImpl extends ActionModeCallbackHelper
              menu.removeItem(R.id.select_action_menu_share);
          }
  
@@ -98,7 +98,7 @@ diff --git a/content/public/android/java/src/org/chromium/content/browser/select
 diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json
 --- a/testing/variations/fieldtrial_testing_config.json
 +++ b/testing/variations/fieldtrial_testing_config.json
-@@ -2026,6 +2026,21 @@
+@@ -2144,6 +2144,21 @@
              ]
          }
      ],
@@ -120,6 +120,5 @@ diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variati
      "ChromeStart": [
          {
              "platforms": [
--- 
-2.20.1
-
+--
+2.25.1

+ 7 - 8
build/patches/Disable-some-signed-exchange-features.patch

@@ -9,24 +9,23 @@ Subject: Disable some signed exchange features
 diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc
 --- a/content/public/common/content_features.cc
 +++ b/content/public/common/content_features.cc
-@@ -719,7 +719,7 @@ const base::Feature kSignedExchangePrefetchCacheForNavigations{
+@@ -760,7 +760,7 @@ const base::Feature kSharedArrayBufferOnDesktop{
  // Signed Exchange Reporting for distributors
- // https://www.chromestatus.com/features/5687904902840320
+ // https://www.chromestatus.com/feature/5687904902840320
  const base::Feature kSignedExchangeReportingForDistributors{
 -    "SignedExchangeReportingForDistributors", base::FEATURE_ENABLED_BY_DEFAULT};
 +    "SignedExchangeReportingForDistributors", base::FEATURE_DISABLED_BY_DEFAULT};
  
  // Subresource prefetching+loading via Signed HTTP Exchange
- // https://www.chromestatus.com/features/5126805474246656
-@@ -729,7 +729,7 @@ const base::Feature kSignedExchangeSubresourcePrefetch{
+ // https://www.chromestatus.com/feature/5126805474246656
+@@ -770,7 +770,7 @@ const base::Feature kSignedExchangeSubresourcePrefetch{
  // Origin-Signed HTTP Exchanges (for WebPackage Loading)
- // https://www.chromestatus.com/features/5745285984681984
+ // https://www.chromestatus.com/feature/5745285984681984
  const base::Feature kSignedHTTPExchange{"SignedHTTPExchange",
 -                                        base::FEATURE_ENABLED_BY_DEFAULT};
 +                                        base::FEATURE_DISABLED_BY_DEFAULT};
  
  // Whether to send a ping to the inner URL upon navigation or not.
  const base::Feature kSignedHTTPExchangePingValidity{
--- 
-2.20.1
-
+--
+2.25.1

+ 5 - 6
build/patches/Disable-support-for-RAR-files-inspection.patch

@@ -73,15 +73,15 @@ diff --git a/chrome/common/safe_browsing/BUILD.gn b/chrome/common/safe_browsing/
 diff --git a/chrome/services/file_util/safe_archive_analyzer.cc b/chrome/services/file_util/safe_archive_analyzer.cc
 --- a/chrome/services/file_util/safe_archive_analyzer.cc
 +++ b/chrome/services/file_util/safe_archive_analyzer.cc
-@@ -7,7 +7,6 @@
- #include "base/macros.h"
+@@ -6,7 +6,6 @@
+ 
  #include "build/build_config.h"
  #include "chrome/common/safe_browsing/archive_analyzer_results.h"
 -#include "chrome/common/safe_browsing/rar_analyzer.h"
  #include "chrome/common/safe_browsing/zip_analyzer.h"
  
  #if defined(OS_MAC)
-@@ -47,8 +46,7 @@ void SafeArchiveAnalyzer::AnalyzeRarFile(base::File rar_file,
+@@ -46,8 +45,7 @@ void SafeArchiveAnalyzer::AnalyzeRarFile(base::File rar_file,
                                           AnalyzeRarFileCallback callback) {
    DCHECK(rar_file.IsValid());
  
@@ -91,6 +91,5 @@ diff --git a/chrome/services/file_util/safe_archive_analyzer.cc b/chrome/service
 -      std::move(rar_file), std::move(temporary_file), &results);
    std::move(callback).Run(results);
  }
--- 
-2.20.1
-
+--
+2.25.1

+ 78 - 46
build/patches/Disable-text-fragments-by-default.patch

@@ -4,43 +4,79 @@ Subject: Disable text fragments by default
 
 Revert "[Text Fragment] Unflag fragment directive removal."
 ---
- chrome/browser/about_flags.cc                 |  1 +
- chrome/browser/flag-metadata.json             |  2 +-
+ chrome/browser/about_flags.cc                 |  5 ++++
+ chrome/browser/flag-metadata.json             |  5 ++++
+ chrome/browser/flag_descriptions.cc           |  4 +++
+ chrome/browser/flag_descriptions.h            |  3 ++
  chrome/browser/ui/prefs/prefs_tab_helper.cc   |  2 +-
- content/child/runtime_features.cc             |  1 +
+ content/child/runtime_features.cc             |  2 +-
  third_party/blink/common/features.cc          |  2 +-
  .../blink/renderer/core/dom/document.cc       |  5 ++++
  .../text_fragment_anchor_metrics_test.cc      | 29 +++++++------------
  .../platform/runtime_enabled_features.json5   |  3 +-
- 8 files changed, 21 insertions(+), 24 deletions(-)
+ 10 files changed, 36 insertions(+), 24 deletions(-)
 
 diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
 --- a/chrome/browser/about_flags.cc
 +++ b/chrome/browser/about_flags.cc
-@@ -5612,6 +5612,7 @@ const FeatureEntry kFeatureEntries[] = {
-      flag_descriptions::kSharingHubDesktopOmniboxDescription, kOsDesktop,
-      FEATURE_VALUE_TYPE(sharing_hub::kSharingHubDesktopOmnibox)},
- #endif  // defined(OS_WIN) || defined(OS_MAC) || defined(OS_LINUX)
-+     // will override runtime text fragment identifiers setting too
+@@ -5360,6 +5360,11 @@ const FeatureEntry kFeatureEntries[] = {
+      FEATURE_VALUE_TYPE(chrome::android::kCCTResizableForThirdParties)},
+ #endif
  
++    {"enable-text-fragment-anchor",
++     flag_descriptions::kEnableTextFragmentAnchorName,
++     flag_descriptions::kEnableTextFragmentAnchorDescription, kOsAll,
++     FEATURE_VALUE_TYPE(blink::features::kTextFragmentAnchor)},
++
  #if BUILDFLAG(IS_CHROMEOS_ASH)
-     {"ash-enable-pip-rounded-corners",
+     {"enforce-system-aec", flag_descriptions::kCrOSEnforceSystemAecName,
+      flag_descriptions::kCrOSEnforceSystemAecDescription, kOsCrOS,
 diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json
 --- a/chrome/browser/flag-metadata.json
 +++ b/chrome/browser/flag-metadata.json
-@@ -3058,7 +3058,7 @@
-   {
-     "name": "ev-details-in-page-info",
-     "owners": [ "cthomp" ],
--    "expiry_milestone": 83
-+    "expiry_milestone": -1
+@@ -2332,6 +2332,11 @@
+     // deep into the future to allow for experiments.
+     "expiry_milestone": 90
    },
++  {
++    "name": "enable-text-fragment-anchor",
++    "owners": [ "bokan", "input-dev" ],
++    "expiry_milestone": -1
++  },
    {
-     "name": "exo-gamepad-vibration",
+     "name": "enable-new-download-api",
+     "owners": [ "sdefresne", "bling-flags@google.com" ],
+diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
+--- a/chrome/browser/flag_descriptions.cc
++++ b/chrome/browser/flag_descriptions.cc
+@@ -1239,6 +1239,10 @@ const char kEnableRestrictedWebApisDescription[] =
+     "Enable the restricted web APIs for dev trial. This will be replaced with "
+     "permission policies to control the capabilities afterwards.";
+ 
++const char kEnableTextFragmentAnchorName[] = "Enable Text Fragment Anchor.";
++const char kEnableTextFragmentAnchorDescription[] =
++    "Enables scrolling to text specified in URL's fragment.";
++
+ const char kEnableUseZoomForDsfName[] =
+     "Use Blink's zoom for device scale factor.";
+ const char kEnableUseZoomForDsfDescription[] =
+diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
+--- a/chrome/browser/flag_descriptions.h
++++ b/chrome/browser/flag_descriptions.h
+@@ -717,6 +717,9 @@ extern const char kEnableRestrictedWebApisDescription[];
+ extern const char kEnableSubresourceRedirectName[];
+ extern const char kEnableSubresourceRedirectDescription[];
+ 
++extern const char kEnableTextFragmentAnchorName[];
++extern const char kEnableTextFragmentAnchorDescription[];
++
+ extern const char kEnableUseZoomForDsfName[];
+ extern const char kEnableUseZoomForDsfDescription[];
+ extern const char kEnableUseZoomForDsfChoiceDefault[];
 diff --git a/chrome/browser/ui/prefs/prefs_tab_helper.cc b/chrome/browser/ui/prefs/prefs_tab_helper.cc
 --- a/chrome/browser/ui/prefs/prefs_tab_helper.cc
 +++ b/chrome/browser/ui/prefs/prefs_tab_helper.cc
-@@ -360,7 +360,7 @@ void PrefsTabHelper::RegisterProfilePrefs(
+@@ -355,7 +355,7 @@ void PrefsTabHelper::RegisterProfilePrefs(
        prefs::kEnableReferrers,
        !base::FeatureList::IsEnabled(features::kNoReferrers));
    registry->RegisterBooleanPref(prefs::kEnableEncryptedMedia, true);
@@ -52,32 +88,33 @@ diff --git a/chrome/browser/ui/prefs/prefs_tab_helper.cc b/chrome/browser/ui/pre
 diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc
 --- a/content/child/runtime_features.cc
 +++ b/content/child/runtime_features.cc
-@@ -263,6 +263,7 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
-     {wf::EnableMouseSubframeNoImplicitCapture,
-      features::kMouseSubframeNoImplicitCapture},
-     {wf::EnableNeverSlowMode, features::kNeverSlowMode},
-+    // will set the TextFragmentIdentifiers runtime feature
-     {wf::EnableNotificationContentImage, features::kNotificationContentImage,
-      kSetOnlyIfOverridden},
-     {wf::EnableParseUrlProtocolHandler,
+@@ -295,7 +295,7 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
+      features::kSignedExchangeSubresourcePrefetch},
+     {wf::EnableSkipTouchEventFilter, blink::features::kSkipTouchEventFilter},
+     {wf::EnableSubresourceWebBundles, features::kSubresourceWebBundles},
+-    {wf::EnableTextFragmentAnchor, blink::features::kTextFragmentAnchor},
++    {wf::EnableTextFragmentAnchor, blink::features::kTextFragmentAnchor}, // will set the TextFragmentIdentifiers runtime feature
+     {wf::EnableCSSSelectorFragmentAnchor,
+      blink::features::kCssSelectorFragmentAnchor},
+     {wf::EnableBackfaceVisibilityInterop,
 diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/features.cc
 --- a/third_party/blink/common/features.cc
 +++ b/third_party/blink/common/features.cc
-@@ -379,7 +379,7 @@ const base::Feature kStorageAccessAPI{"StorageAccessAPI",
+@@ -399,7 +399,7 @@ const base::Feature kStorageAccessAPI{"StorageAccessAPI",
  
  // Enable text snippets in URL fragments. https://crbug.com/919204.
  const base::Feature kTextFragmentAnchor{"TextFragmentAnchor",
 -                                        base::FEATURE_ENABLED_BY_DEFAULT};
 +                                        base::FEATURE_DISABLED_BY_DEFAULT};
  
- // File handling integration. https://crbug.com/829689
- const base::Feature kFileHandlingAPI{"FileHandlingAPI",
+ // Enables CSS selector fragment anchors. https://crbug.com/1252460
+ const base::Feature kCssSelectorFragmentAnchor{
 diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink/renderer/core/dom/document.cc
 --- a/third_party/blink/renderer/core/dom/document.cc
 +++ b/third_party/blink/renderer/core/dom/document.cc
-@@ -4063,6 +4063,10 @@ void Document::SetURL(const KURL& url) {
-     }
-   }
+@@ -4068,9 +4068,14 @@ void Document::SetURL(const KURL& url) {
+   TRACE_EVENT1("navigation", "Document::SetURL", "url",
+                new_url.GetString().Utf8());
  
 +  // If text fragment identifiers are enabled, we strip the fragment directive
 +  // from the URL fragment.
@@ -85,19 +122,15 @@ diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink
 +  if (RuntimeEnabledFeatures::TextFragmentIdentifiersEnabled(domWindow())) {
    // Strip the fragment directive from the URL fragment. E.g. "#id:~:text=a"
    // --> "#id". See https://github.com/WICG/scroll-to-text-fragment.
-   String fragment = new_url.FragmentIdentifier();
-@@ -4076,6 +4080,7 @@ void Document::SetURL(const KURL& url) {
-     else
-       new_url.SetFragmentIdentifier(fragment.Substring(0, start_pos));
-   }
+   new_url = fragment_directive_->ConsumeFragmentDirective(new_url);
 +  }
  
    url_ = new_url;
-   access_entry_from_url_ = nullptr;
-diff --git a/third_party/blink/renderer/core/page/scrolling/text_fragment_anchor_metrics_test.cc b/third_party/blink/renderer/core/page/scrolling/text_fragment_anchor_metrics_test.cc
---- a/third_party/blink/renderer/core/page/scrolling/text_fragment_anchor_metrics_test.cc
-+++ b/third_party/blink/renderer/core/page/scrolling/text_fragment_anchor_metrics_test.cc
-@@ -1249,34 +1249,25 @@ TEST_P(TextFragmentRelatedMetricTest, ElementIdSuccessFailureCounts) {
+   UpdateBaseURL();
+diff --git a/third_party/blink/renderer/core/fragment_directive/text_fragment_anchor_metrics_test.cc b/third_party/blink/renderer/core/fragment_directive/text_fragment_anchor_metrics_test.cc
+--- a/third_party/blink/renderer/core/fragment_directive/text_fragment_anchor_metrics_test.cc
++++ b/third_party/blink/renderer/core/fragment_directive/text_fragment_anchor_metrics_test.cc
+@@ -1251,34 +1251,25 @@ TEST_P(TextFragmentRelatedMetricTest, ElementIdSuccessFailureCounts) {
    // result of the element-id fragment if a text directive is successfully
    // parsed. If the feature is off we treat the text directive as an element-id
    // and should count the result.
@@ -145,7 +178,7 @@ diff --git a/third_party/blink/renderer/core/page/scrolling/text_fragment_anchor
 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
-@@ -2173,8 +2173,7 @@
+@@ -2262,8 +2262,7 @@
      },
      {
        name: "TextFragmentIdentifiers",
@@ -155,6 +188,5 @@ diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5
      },
      {
        name: "TextFragmentTapOpensContextMenu",
--- 
-2.20.1
-
+--
+2.25.1

+ 4 - 5
build/patches/Disable-the-DIAL-repeating-discovery.patch

@@ -10,7 +10,7 @@ This causes unnecessary SSDP network spam
 diff --git a/chrome/browser/media/router/discovery/dial/dial_registry.cc b/chrome/browser/media/router/discovery/dial/dial_registry.cc
 --- a/chrome/browser/media/router/discovery/dial/dial_registry.cc
 +++ b/chrome/browser/media/router/discovery/dial/dial_registry.cc
-@@ -191,10 +191,6 @@ void DialRegistry::StartPeriodicDiscovery() {
+@@ -190,10 +190,6 @@ void DialRegistry::StartPeriodicDiscovery() {
  
    dial_ = CreateDialService();
    dial_->AddObserver(this);
@@ -21,7 +21,7 @@ diff --git a/chrome/browser/media/router/discovery/dial/dial_registry.cc b/chrom
  }
  
  void DialRegistry::DoDiscovery() {
-@@ -208,8 +204,6 @@ void DialRegistry::StopPeriodicDiscovery() {
+@@ -207,8 +203,6 @@ void DialRegistry::StopPeriodicDiscovery() {
    if (!dial_)
      return;
  
@@ -30,6 +30,5 @@ diff --git a/chrome/browser/media/router/discovery/dial/dial_registry.cc b/chrom
    dial_->RemoveObserver(this);
    ClearDialService();
  }
--- 
-2.20.1
-
+--
+2.25.1

+ 14 - 16
build/patches/Disable-third-party-cookies-by-default.patch

@@ -2,23 +2,21 @@ From: csagan5 <32685696+csagan5@users.noreply.github.com>
 Date: Wed, 11 Oct 2017 22:50:10 +0200
 Subject: Disable third-party cookies by default
 
-author: Chad Miller <chad.miller@canonical.com>
 ---
- chrome/browser/prefs/browser_prefs.cc | 2 +-
+ components/content_settings/core/browser/cookie_settings.cc | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
-diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
---- a/chrome/browser/prefs/browser_prefs.cc
-+++ b/chrome/browser/prefs/browser_prefs.cc
-@@ -717,7 +717,7 @@ void RegisterProfilePrefsForMigration(
+diff --git a/components/content_settings/core/browser/cookie_settings.cc b/components/content_settings/core/browser/cookie_settings.cc
+--- a/components/content_settings/core/browser/cookie_settings.cc
++++ b/components/content_settings/core/browser/cookie_settings.cc
+@@ -63,7 +63,7 @@ void CookieSettings::RegisterProfilePrefs(
+     user_prefs::PrefRegistrySyncable* registry) {
+   registry->RegisterIntegerPref(
+       prefs::kCookieControlsMode,
+-      static_cast<int>(CookieControlsMode::kIncognitoOnly),
++      static_cast<int>(CookieControlsMode::kBlockThirdParty),
+       user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
+ }
  
-   chrome_browser_net::secure_dns::RegisterProbesSettingBackupPref(registry);
- 
--  registry->RegisterBooleanPref(kBlockThirdPartyCookies, false);
-+  registry->RegisterBooleanPref(kBlockThirdPartyCookies, true);
- 
-   registry->RegisterTimePref(kPluginsDeprecationInfobarLastShown, base::Time());
- 
--- 
-2.20.1
-
+--
+2.25.1

+ 158 - 35
build/patches/Disable-third-party-origin-trials.patch

@@ -3,13 +3,16 @@ Date: Thu, 4 Nov 2021 09:19:24 +0100
 Subject: Disable third-party origin trials
 
 ---
- .../origin_trials/origin_trial_policy_impl.cc    |  7 ++++---
- .../origin_trials/origin_trial_policy_impl.h     |  2 +-
- .../shell/common/shell_origin_trial_policy.cc    | 10 ++++------
- .../blink/renderer/core/loader/http_equiv.cc     | 16 ----------------
- .../core/origin_trials/origin_trial_context.cc   | 13 ++-----------
- .../platform/runtime_enabled_features.json5      |  4 ----
- 6 files changed, 11 insertions(+), 41 deletions(-)
+ .../origin_trials/origin_trial_policy_impl.cc   |  7 ++++---
+ .../origin_trials/origin_trial_policy_impl.h    |  2 +-
+ .../browser/renderer_host/navigation_request.cc |  1 -
+ content/renderer/render_frame_impl.cc           | 17 +----------------
+ .../shell/common/shell_origin_trial_policy.cc   | 10 ++++------
+ .../renderer/core/loader/document_loader.cc     | 17 -----------------
+ .../blink/renderer/core/loader/http_equiv.cc    | 14 ++------------
+ .../core/origin_trials/origin_trial_context.cc  | 12 +++---------
+ .../platform/runtime_enabled_features.json5     |  4 ++++
+ 9 files changed, 19 insertions(+), 65 deletions(-)
 
 diff --git a/components/embedder_support/origin_trials/origin_trial_policy_impl.cc b/components/embedder_support/origin_trials/origin_trial_policy_impl.cc
 --- a/components/embedder_support/origin_trials/origin_trial_policy_impl.cc
@@ -40,7 +43,7 @@ diff --git a/components/embedder_support/origin_trials/origin_trial_policy_impl.
 diff --git a/components/embedder_support/origin_trials/origin_trial_policy_impl.h b/components/embedder_support/origin_trials/origin_trial_policy_impl.h
 --- a/components/embedder_support/origin_trials/origin_trial_policy_impl.h
 +++ b/components/embedder_support/origin_trials/origin_trial_policy_impl.h
-@@ -31,11 +31,11 @@ class OriginTrialPolicyImpl : public blink::OriginTrialPolicy {
+@@ -34,11 +34,11 @@ class OriginTrialPolicyImpl : public blink::OriginTrialPolicy {
    bool IsTokenDisabled(base::StringPiece token_signature) const override;
    bool IsOriginSecure(const GURL& url) const override;
  
@@ -53,6 +56,65 @@ diff --git a/components/embedder_support/origin_trials/origin_trial_policy_impl.
    std::vector<blink::OriginTrialPublicKey> public_keys_;
    std::set<std::string> disabled_features_;
    std::set<std::string> disabled_tokens_;
+diff --git a/content/browser/renderer_host/navigation_request.cc b/content/browser/renderer_host/navigation_request.cc
+--- a/content/browser/renderer_host/navigation_request.cc
++++ b/content/browser/renderer_host/navigation_request.cc
+@@ -6705,7 +6705,6 @@ void NavigationRequest::RestartBackForwardCachedNavigationImpl() {
+ void NavigationRequest::ForceEnableOriginTrials(
+     const std::vector<std::string>& trials) {
+   DCHECK(!HasCommitted());
+-  commit_params_->force_enabled_origin_trials = trials;
+ }
+ 
+ absl::optional<network::mojom::BlockedByResponseReason>
+diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
+--- a/content/renderer/render_frame_impl.cc
++++ b/content/renderer/render_frame_impl.cc
+@@ -480,10 +480,6 @@ void FillNavigationParamsRequest(
+         common_params.initiator_origin.value();
+   }
+ 
+-  navigation_params->initiator_origin_trial_features = {
+-      common_params.initiator_origin_trial_features.begin(),
+-      common_params.initiator_origin_trial_features.end()};
+-
+   navigation_params->was_discarded = commit_params.was_discarded;
+   navigation_params->document_ukm_source_id =
+       commit_params.document_ukm_source_id;
+@@ -516,12 +512,6 @@ void FillNavigationParamsRequest(
+   navigation_params->web_bundle_claimed_url =
+       commit_params.web_bundle_claimed_url;
+ 
+-  WebVector<WebString> web_origin_trials;
+-  web_origin_trials.reserve(commit_params.force_enabled_origin_trials.size());
+-  for (const auto& trial : commit_params.force_enabled_origin_trials)
+-    web_origin_trials.emplace_back(WebString::FromASCII(trial));
+-  navigation_params->force_enabled_origin_trials = web_origin_trials;
+-
+   if (!commit_params.early_hints_preloaded_resources.empty()) {
+     navigation_params->early_hints_preloaded_resources = WebVector<WebURL>();
+     for (const auto& resource : commit_params.early_hints_preloaded_resources) {
+@@ -568,11 +558,6 @@ blink::mojom::CommonNavigationParamsPtr MakeCommonNavigationParams(
+           info->url_request.GetURLRequestExtraData().get());
+   DCHECK(url_request_extra_data);
+ 
+-  // Convert from WebVector<int> to std::vector<int>.
+-  std::vector<int> initiator_origin_trial_features(
+-      info->initiator_origin_trial_features.begin(),
+-      info->initiator_origin_trial_features.end());
+-
+   blink::NavigationDownloadPolicy download_policy;
+   download_policy.ApplyDownloadFramePolicy(
+       info->is_opener_navigation, info->url_request.HasUserGesture(),
+@@ -591,7 +576,7 @@ blink::mojom::CommonNavigationParamsPtr MakeCommonNavigationParams(
+       info->url_request.HasUserGesture(),
+       info->url_request.HasTextFragmentToken(),
+       info->should_check_main_world_content_security_policy,
+-      initiator_origin_trial_features, info->href_translate.Latin1(),
++      /*initiator_origin_trial_features*/std::vector<int>(), info->href_translate.Latin1(),
+       is_history_navigation_in_new_child_frame, info->input_start,
+       request_destination);
+ }
 diff --git a/content/shell/common/shell_origin_trial_policy.cc b/content/shell/common/shell_origin_trial_policy.cc
 --- a/content/shell/common/shell_origin_trial_policy.cc
 +++ b/content/shell/common/shell_origin_trial_policy.cc
@@ -82,10 +144,56 @@ diff --git a/content/shell/common/shell_origin_trial_policy.cc b/content/shell/c
  }
  
  const std::vector<blink::OriginTrialPublicKey>&
+diff --git a/third_party/blink/renderer/core/loader/document_loader.cc b/third_party/blink/renderer/core/loader/document_loader.cc
+--- a/third_party/blink/renderer/core/loader/document_loader.cc
++++ b/third_party/blink/renderer/core/loader/document_loader.cc
+@@ -150,31 +150,18 @@ Vector<OriginTrialFeature> CopyInitiatorOriginTrials(
+ WebVector<int> CopyInitiatorOriginTrials(
+     const Vector<OriginTrialFeature>& initiator_origin_trial_features) {
+   WebVector<int> result;
+-  for (auto feature : initiator_origin_trial_features) {
+-    // Convert from OriginTrialFeature to int. These values are passed between
+-    // blink navigations. OriginTrialFeature isn't visible outside of blink (and
+-    // doesn't need to be) so the values are transferred outside of blink as
+-    // ints and casted to OriginTrialFeature once being processed in blink.
+-    result.emplace_back(static_cast<int>(feature));
+-  }
+   return result;
+ }
+ 
+ Vector<String> CopyForceEnabledOriginTrials(
+     const WebVector<WebString>& force_enabled_origin_trials) {
+   Vector<String> result;
+-  result.ReserveInitialCapacity(
+-      SafeCast<wtf_size_t>(force_enabled_origin_trials.size()));
+-  for (const auto& trial : force_enabled_origin_trials)
+-    result.push_back(trial);
+   return result;
+ }
+ 
+ WebVector<WebString> CopyForceEnabledOriginTrials(
+     const Vector<String>& force_enabled_origin_trials) {
+   WebVector<String> result;
+-  for (const auto& trial : force_enabled_origin_trials)
+-    result.emplace_back(trial);
+   return result;
+ }
+ 
+@@ -2468,10 +2455,6 @@ void DocumentLoader::CreateParserPostCommit() {
+           OriginTrialFeature::kTouchEventFeatureDetection);
+     }
+ 
+-    // Enable any origin trials that have been force enabled for this commit.
+-    window->GetOriginTrialContext()->AddForceEnabledTrials(
+-        force_enabled_origin_trials_);
+-
+     OriginTrialContext::ActivateNavigationFeaturesFromInitiator(
+         window, &initiator_origin_trial_features_);
+   }
 diff --git a/third_party/blink/renderer/core/loader/http_equiv.cc b/third_party/blink/renderer/core/loader/http_equiv.cc
 --- a/third_party/blink/renderer/core/loader/http_equiv.cc
 +++ b/third_party/blink/renderer/core/loader/http_equiv.cc
-@@ -148,22 +148,6 @@ void HttpEquiv::ProcessHttpEquivOriginTrial(LocalDOMWindow* window,
+@@ -106,23 +106,13 @@ void HttpEquiv::ProcessHttpEquivOriginTrial(LocalDOMWindow* window,
                                              const AtomicString& content) {
    if (!window)
      return;
@@ -94,57 +202,72 @@ diff --git a/third_party/blink/renderer/core/loader/http_equiv.cc b/third_party/
 -  // NOTE: The external script origin is not considered security-critical. See
 -  // the comment thread in the design doc for details:
 -  // https://docs.google.com/document/d/1xALH9W7rWmX0FpjudhDeS2TNTEOXuPn4Tlc9VmuPdHA/edit?disco=AAAAJyG8StI
--  if (RuntimeEnabledFeatures::ThirdPartyOriginTrialsEnabled()) {
--    KURL external_script_url(GetCurrentScriptUrl(/*max_stack_depth=*/1));
--
--    if (external_script_url.IsValid()) {
--      scoped_refptr<SecurityOrigin> external_origin =
--          SecurityOrigin::Create(external_script_url);
--      window->GetOriginTrialContext()->AddTokenFromExternalScript(
--          content, external_origin.get());
--      return;
--    }
+-  KURL external_script_url(GetCurrentScriptUrl(/*max_stack_depth=*/1));
+ 
+-  if (external_script_url.IsValid()) {
+-    scoped_refptr<SecurityOrigin> external_origin =
+-        SecurityOrigin::Create(external_script_url);
+-    window->GetOriginTrialContext()->AddTokenFromExternalScript(
+-        content, external_origin.get());
++  if (!RuntimeEnabledFeatures::ThirdPartyOriginTrialsEnabled())
+     return;
 -  }
  
    // Process token as usual, without an external script origin.
    window->GetOriginTrialContext()->AddToken(content);
++
+ }
+ 
+ void HttpEquiv::ProcessHttpEquivRefresh(LocalDOMWindow* window,
 diff --git a/third_party/blink/renderer/core/origin_trials/origin_trial_context.cc b/third_party/blink/renderer/core/origin_trials/origin_trial_context.cc
 --- a/third_party/blink/renderer/core/origin_trials/origin_trial_context.cc
 +++ b/third_party/blink/renderer/core/origin_trials/origin_trial_context.cc
-@@ -275,17 +275,8 @@ void OriginTrialContext::AddToken(const String& token) {
+@@ -30,6 +30,7 @@
+ #include "third_party/blink/renderer/platform/bindings/origin_trial_features.h"
+ #include "third_party/blink/renderer/platform/bindings/script_state.h"
+ #include "third_party/blink/renderer/platform/instrumentation/histogram.h"
++#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
+ #include "third_party/blink/renderer/platform/weborigin/security_origin.h"
+ #include "third_party/blink/renderer/platform/wtf/text/string_builder.h"
+ #include "third_party/blink/renderer/platform/wtf/text/string_utf8_adaptor.h"
+@@ -277,13 +278,8 @@ void OriginTrialContext::AddToken(const String& token) {
  void OriginTrialContext::AddTokenFromExternalScript(
      const String& token,
      const SecurityOrigin* origin) {
 -  bool is_script_origin_secure = false;
--  if (origin &&
--      RuntimeEnabledFeatures::ThirdPartyOriginTrialsEnabled(context_)) {
--    DVLOG(1) << "AddTokenFromExternalScript: "
--             << (origin ? origin->ToString() : "null");
+-  if (origin) {
+-    DVLOG(1) << "AddTokenFromExternalScript: " << origin->ToString();
 -    is_script_origin_secure = origin->IsPotentiallyTrustworthy();
--  } else {
--    origin = nullptr;
 -  }
 -  AddTokenInternal(token, GetSecurityOrigin(), IsSecureContext(), origin,
 -                   is_script_origin_secure);
 +  AddTokenInternal(token, GetSecurityOrigin(), IsSecureContext(), nullptr,
-+                   false);
++                   false /* is_script_origin_secure */);
  }
  
  void OriginTrialContext::AddTokenInternal(const String& token,
+@@ -395,8 +391,6 @@ bool OriginTrialContext::InstallSettingFeature(
+ }
+ 
+ void OriginTrialContext::AddFeature(OriginTrialFeature feature) {
+-  enabled_features_.insert(feature);
+-  InitializePendingFeatures();
+ }
+ 
+ bool OriginTrialContext::IsFeatureEnabled(OriginTrialFeature feature) const {
 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
-@@ -2183,10 +2183,6 @@
+@@ -2272,6 +2272,10 @@
        name: "TextFragmentTapOpensContextMenu",
        status: {"Android": "stable"},
      },
--    {
--      name: "ThirdPartyOriginTrials",
--      status: "stable",
--    },
++    {
++      name: "ThirdPartyOriginTrials",
++      status: "stable",
++    },
      {
        name: "ThrottleDisplayNoneAndVisibilityHiddenCrossOriginIframes",
        status: "experimental",
--- 
-2.20.1
-
+--
+2.25.1

+ 3 - 4
build/patches/Disable-unified-autoplay-feature.patch

@@ -9,7 +9,7 @@ Subject: Disable unified autoplay feature
 diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc
 --- a/media/base/media_switches.cc
 +++ b/media/base/media_switches.cc
-@@ -480,7 +480,7 @@ const base::Feature kUseR16Texture{"use-r16-texture",
+@@ -464,7 +464,7 @@ const base::Feature kUseR16Texture{"use-r16-texture",
  // Enables the Unified Autoplay policy by overriding the platform's default
  // autoplay policy.
  const base::Feature kUnifiedAutoplay{"UnifiedAutoplay",
@@ -18,6 +18,5 @@ diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc
  
  #if defined(OS_LINUX)
  // Enable vaapi video decoding on linux. This is already enabled by default on
--- 
-2.20.1
-
+--
+2.25.1

+ 2 - 3
build/patches/Disable-update-scheduler.patch

@@ -20,6 +20,5 @@ diff --git a/components/component_updater/android/java/src/org/chromium/componen
      }
  
      /* package */ void onStartTaskBeforeNativeLoaded(TaskFinishedCallback callback) {
--- 
-2.20.1
-
+--
+2.25.1

+ 89 - 0
build/patches/Disable-various-metrics.patch

@@ -0,0 +1,89 @@
+From: csagan5 <32685696+csagan5@users.noreply.github.com>
+Date: Wed, 16 Feb 2022 11:32:33 +0100
+Subject: Disable various metrics
+
+Including initial metrics opt-out
+---
+ .../browser/firstrun/FirstRunActivityBase.java    |  2 +-
+ chrome/browser/chrome_content_browser_client.cc   | 15 ---------------
+ .../chrome_metrics_services_manager_client.cc     |  2 +-
+ services/metrics/public/cpp/ukm_recorder.cc       |  2 +-
+ 4 files changed, 3 insertions(+), 18 deletions(-)
+
+diff --git a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivityBase.java b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivityBase.java
+--- a/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivityBase.java
++++ b/chrome/android/java/src/org/chromium/chrome/browser/firstrun/FirstRunActivityBase.java
+@@ -46,7 +46,7 @@ public abstract class FirstRunActivityBase extends AsyncInitializationActivity {
+ 
+     static final String OPEN_ADVANCED_SYNC_SETTINGS = "OpenAdvancedSyncSettings";
+ 
+-    public static final boolean DEFAULT_METRICS_AND_CRASH_REPORTING = true;
++    public static final boolean DEFAULT_METRICS_AND_CRASH_REPORTING = false;
+ 
+     private boolean mNativeInitialized;
+ 
+diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
+--- a/chrome/browser/chrome_content_browser_client.cc
++++ b/chrome/browser/chrome_content_browser_client.cc
+@@ -61,7 +61,6 @@
+ #include "chrome/browser/hid/chrome_hid_delegate.h"
+ #include "chrome/browser/interstitials/enterprise_util.h"
+ #include "chrome/browser/lifetime/browser_shutdown.h"
+-#include "chrome/browser/lookalikes/lookalike_url_navigation_throttle.h"
+ #include "chrome/browser/media/audio_service_util.h"
+ #include "chrome/browser/media/router/media_router_feature.h"
+ #include "chrome/browser/media/webrtc/audio_debug_recordings_handler.h"
+@@ -4114,16 +4113,6 @@ ChromeContentBrowserClient::CreateThrottlesForNavigation(
+     content::NavigationHandle* handle) {
+   std::vector<std::unique_ptr<content::NavigationThrottle>> throttles;
+ 
+-  // MetricsNavigationThrottle requires that it runs before NavigationThrottles
+-  // that may delay or cancel navigations, so only NavigationThrottles that
+-  // don't delay or cancel navigations (e.g. throttles that are only observing
+-  // callbacks without affecting navigation behavior) should be added before
+-  // MetricsNavigationThrottle.
+-  if (handle->IsInMainFrame()) {
+-    throttles.push_back(
+-        page_load_metrics::MetricsNavigationThrottle::Create(handle));
+-  }
+-
+ #if BUILDFLAG(IS_CHROMEOS_ASH)
+   MaybeAddThrottle(
+       ash::WebTimeLimitNavigationThrottle::MaybeCreateThrottleFor(handle),
+@@ -4221,10 +4210,6 @@ ChromeContentBrowserClient::CreateThrottlesForNavigation(
+                    &throttles);
+ #endif
+ 
+-  MaybeAddThrottle(
+-      LookalikeUrlNavigationThrottle::MaybeCreateNavigationThrottle(handle),
+-      &throttles);
+-
+   MaybeAddThrottle(PDFIFrameNavigationThrottle::MaybeCreateThrottleFor(handle),
+                    &throttles);
+ #if BUILDFLAG(ENABLE_PDF)
+diff --git a/chrome/browser/metrics/chrome_metrics_services_manager_client.cc b/chrome/browser/metrics/chrome_metrics_services_manager_client.cc
+--- a/chrome/browser/metrics/chrome_metrics_services_manager_client.cc
++++ b/chrome/browser/metrics/chrome_metrics_services_manager_client.cc
+@@ -74,7 +74,7 @@ namespace internal {
+ // recording and reporting are enabled. If the feature is enabled, but no
+ // consent is given, then there will be no recording or reporting.
+ const base::Feature kMetricsReportingFeature{"MetricsReporting",
+-                                             base::FEATURE_ENABLED_BY_DEFAULT};
++                                             base::FEATURE_DISABLED_BY_DEFAULT};
+ 
+ }  // namespace internal
+ }  // namespace metrics
+diff --git a/services/metrics/public/cpp/ukm_recorder.cc b/services/metrics/public/cpp/ukm_recorder.cc
+--- a/services/metrics/public/cpp/ukm_recorder.cc
++++ b/services/metrics/public/cpp/ukm_recorder.cc
+@@ -13,7 +13,7 @@
+ 
+ namespace ukm {
+ 
+-const base::Feature kUkmFeature = {"Ukm", base::FEATURE_ENABLED_BY_DEFAULT};
++const base::Feature kUkmFeature = {"Ukm", base::FEATURE_DISABLED_BY_DEFAULT}; // disabled in Bromite
+ 
+ UkmRecorder::UkmRecorder() = default;
+ 
+--
+2.25.1

+ 5 - 6
build/patches/Do-not-build-API-keys-infobar.patch

@@ -9,15 +9,14 @@ Subject: Do not build API keys infobar
 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
-@@ -1194,8 +1194,6 @@ static_library("ui") {
+@@ -1248,8 +1248,6 @@ static_library("ui") {
        "singleton_tabs.h",
        "startup/automation_infobar_delegate.cc",
        "startup/automation_infobar_delegate.h",
 -      "startup/google_api_keys_infobar_delegate.cc",
 -      "startup/google_api_keys_infobar_delegate.h",
+       "startup/infobar_utils.cc",
+       "startup/infobar_utils.h",
        "startup/launch_mode_recorder.cc",
-       "startup/launch_mode_recorder.h",
-       "startup/obsolete_system_infobar_delegate.cc",
--- 
-2.20.1
-
+--
+2.25.1

+ 9 - 10
build/patches/Do-not-compile-QR-code-sharing.patch

@@ -11,15 +11,15 @@ Subject: Do not compile QR code sharing
 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
-@@ -79,7 +79,6 @@ import org.chromium.chrome.browser.share.ShareButtonController;
+@@ -82,7 +82,6 @@ import org.chromium.chrome.browser.share.ShareButtonController;
  import org.chromium.chrome.browser.share.ShareDelegate;
  import org.chromium.chrome.browser.share.ShareDelegate.ShareOrigin;
  import org.chromium.chrome.browser.share.ShareUtils;
 -import org.chromium.chrome.browser.share.qrcode.QrCodeDialog;
+ import org.chromium.chrome.browser.share.scroll_capture.ScrollCaptureManager;
  import org.chromium.chrome.browser.tab.AccessibilityVisibilityHandler;
  import org.chromium.chrome.browser.tab.AutofillSessionLifetimeController;
- import org.chromium.chrome.browser.tab.Tab;
-@@ -402,10 +401,6 @@ public class RootUiCoordinator
+@@ -423,10 +422,6 @@ public class RootUiCoordinator
      }
  
      public void onAttachFragment(Fragment fragment) {
@@ -33,7 +33,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordi
 diff --git a/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/share_sheet/ChromeProvidedSharingOptionsProvider.java b/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/share_sheet/ChromeProvidedSharingOptionsProvider.java
 --- a/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/share_sheet/ChromeProvidedSharingOptionsProvider.java
 +++ b/chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/share_sheet/ChromeProvidedSharingOptionsProvider.java
-@@ -25,7 +25,6 @@ import org.chromium.chrome.browser.profiles.Profile;
+@@ -29,7 +29,6 @@ import org.chromium.chrome.browser.share.ChromeShareExtras.DetailedContentType;
  import org.chromium.chrome.browser.share.SaveBitmapDelegate;
  import org.chromium.chrome.browser.share.link_to_text.LinkToTextCoordinator.LinkGeneration;
  import org.chromium.chrome.browser.share.long_screenshots.LongScreenshotsCoordinator;
@@ -41,7 +41,7 @@ diff --git a/chrome/browser/share/android/java/src/org/chromium/chrome/browser/s
  import org.chromium.chrome.browser.share.screenshot.ScreenshotCoordinator;
  import org.chromium.chrome.browser.share.send_tab_to_self.SendTabToSelfCoordinator;
  import org.chromium.chrome.browser.share.share_sheet.ShareSheetLinkToggleMetricsHelper.LinkToggleMetricsDetails;
-@@ -255,9 +254,6 @@ public class ChromeProvidedSharingOptionsProvider {
+@@ -297,9 +296,6 @@ public class ChromeProvidedSharingOptionsProvider {
          mOrderedFirstPartyOptions.add(createCopyFirstPartyOption());
          mOrderedFirstPartyOptions.add(createCopyTextFirstPartyOption());
          mOrderedFirstPartyOptions.add(createSendTabToSelfFirstPartyOption());
@@ -51,7 +51,7 @@ diff --git a/chrome/browser/share/android/java/src/org/chromium/chrome/browser/s
          if (UserPrefs.get(Profile.getLastUsedRegularProfile()).getBoolean(Pref.PRINTING_ENABLED)) {
              mOrderedFirstPartyOptions.add(createPrintingFirstPartyOption());
          }
-@@ -410,19 +406,6 @@ public class ChromeProvidedSharingOptionsProvider {
+@@ -423,19 +419,6 @@ public class ChromeProvidedSharingOptionsProvider {
                  .build();
      }
  
@@ -74,7 +74,7 @@ diff --git a/chrome/browser/share/android/java/src/org/chromium/chrome/browser/s
 diff --git a/chrome/browser/share/android/java_sources.gni b/chrome/browser/share/android/java_sources.gni
 --- a/chrome/browser/share/android/java_sources.gni
 +++ b/chrome/browser/share/android/java_sources.gni
-@@ -23,24 +23,6 @@ share_java_sources = [
+@@ -25,24 +25,6 @@ share_java_sources = [
    "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/long_screenshots/bitmap_generation/LongScreenshotsTabService.java",
    "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/long_screenshots/bitmap_generation/LongScreenshotsTabServiceFactory.java",
    "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/long_screenshots/bitmap_generation/ScreenshotBoundsManager.java",
@@ -99,6 +99,5 @@ diff --git a/chrome/browser/share/android/java_sources.gni b/chrome/browser/shar
    "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/screenshot/EditorScreenshotSource.java",
    "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/screenshot/EditorScreenshotTask.java",
    "//chrome/browser/share/android/java/src/org/chromium/chrome/browser/share/screenshot/ScreenshotCoordinator.java",
--- 
-2.20.1
-
+--
+2.25.1

+ 3 - 4
build/patches/Do-not-hide-component-extensions.patch

@@ -9,7 +9,7 @@ Subject: Do not hide component extensions
 diff --git a/extensions/common/extension.cc b/extensions/common/extension.cc
 --- a/extensions/common/extension.cc
 +++ b/extensions/common/extension.cc
-@@ -439,9 +439,8 @@ bool Extension::ShouldDisplayInNewTabPage() const {
+@@ -455,9 +455,8 @@ bool Extension::ShouldDisplayInNewTabPage() const {
  }
  
  bool Extension::ShouldExposeViaManagementAPI() const {
@@ -21,6 +21,5 @@ diff --git a/extensions/common/extension.cc b/extensions/common/extension.cc
  }
  
  Extension::ManifestData* Extension::GetManifestData(const std::string& key)
--- 
-2.20.1
-
+--
+2.25.1

+ 8 - 8
build/patches/Do-not-ignore-download-location-prompt-setting.patch

@@ -8,21 +8,22 @@ do not skip the prompt in such cases.
 
 Do not tick "Don't show again" by default
 ---
- .../dialogs/DownloadLocationDialogCoordinator.java | 14 --------------
- 1 file changed, 14 deletions(-)
+ .../DownloadLocationDialogCoordinator.java        | 15 ---------------
+ 1 file changed, 15 deletions(-)
 
 diff --git a/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationDialogCoordinator.java b/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationDialogCoordinator.java
 --- a/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationDialogCoordinator.java
 +++ b/chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationDialogCoordinator.java
-@@ -128,20 +128,6 @@ public class DownloadLocationDialogCoordinator implements ModalDialogProperties.
+@@ -132,21 +132,6 @@ public class DownloadLocationDialogCoordinator implements ModalDialogProperties.
       * @param dirs An list of available download directories.
       */
      private void onDirectoryOptionsRetrieved(ArrayList<DirectoryOption> dirs) {
 -        // If there is only one directory available, don't show the default dialog, and set the
 -        // download directory to default. Dialog will still show for other types of dialogs, like
--        // name conflict or disk error.
+-        // name conflict or disk error or if Incognito download warning is needed.
 -        if (dirs.size() == 1 && !mLocationDialogManaged
--                && mDialogType == DownloadLocationDialogType.DEFAULT) {
+-                && mDialogType == DownloadLocationDialogType.DEFAULT
+-                && !shouldShowIncognitoWarning()) {
 -            final DirectoryOption dir = dirs.get(0);
 -            if (dir.type == DirectoryOption.DownloadLocationDirectoryType.DEFAULT) {
 -                assert (!TextUtils.isEmpty(dir.location));
@@ -35,6 +36,5 @@ diff --git a/chrome/browser/download/android/java/src/org/chromium/chrome/browse
          // Already showing the dialog.
          if (mDialogModel != null) return;
  
--- 
-2.20.1
-
+--
+2.25.1

+ 24 - 0
build/patches/Do-not-link-with-libatomic.patch

@@ -0,0 +1,24 @@
+From: uazo <uazo@users.noreply.github.com>
+Date: Tue, 11 Jan 2022 13:59:32 +0000
+Subject: Do not link with libatomic
+
+Compiler has built-in support thus libatomic linking is no more needed
+This patch allows building with use_sysroot=false
+---
+ base/BUILD.gn | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/base/BUILD.gn b/base/BUILD.gn
+--- a/base/BUILD.gn
++++ b/base/BUILD.gn
+@@ -1418,7 +1418,7 @@ component("base") {
+   if (!use_sysroot &&
+       (is_android || ((is_linux || is_chromeos) && !is_chromecast)) &&
+       host_toolchain != "//build/toolchain/cros:host") {
+-    libs += [ "atomic" ]
++    #libs += [ "atomic" ]
+   }
+ 
+   if (use_allocator_shim) {
+--
+2.25.1

+ 2 - 3
build/patches/Do-not-store-passwords-by-default.patch

@@ -22,6 +22,5 @@ diff --git a/components/password_manager/core/browser/password_manager.cc b/comp
        user_prefs::PrefRegistrySyncable::SYNCABLE_PRIORITY_PREF);
    registry->RegisterStringPref(prefs::kSyncPasswordHash, std::string(),
                                 PrefRegistry::NO_REGISTRATION_FLAGS);
--- 
-2.20.1
-
+--
+2.25.1

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio