Browse Source

Update to 99.0.4844.51-1

master 99.0.4844.51-1-webview
wchen342 9 months ago
parent
commit
d00916d5e8
Signed by: wchen342 GPG Key ID: 9C19365D69B04CEC
  1. 4
      .build_config
  2. 7
      CHANGELOG.md
  3. 1
      android_flags.debug.gn
  4. 861
      domain_sub_2.list
  5. 37
      patches/Bromite/AImageReader-CFI-crash-mitigations.patch
  6. 129
      patches/Bromite/Add-a-proxy-configuration-page.patch
  7. 98
      patches/Bromite/Add-an-always-incognito-mode.patch
  8. 114
      patches/Bromite/Add-bookmark-import-export-actions.patch
  9. 35
      patches/Bromite/Add-exit-menu-item.patch
  10. 10
      patches/Bromite/Add-flag-to-disable-WebGL.patch
  11. 18
      patches/Bromite/Add-option-to-not-persist-tabs-across-sessions.patch
  12. 30
      patches/Bromite/Change-default-webRTC-policy-to-not-use-any-address.patch
  13. 2
      patches/Bromite/Disable-DRM-media-origin-IDs-preprovisioning.patch
  14. 13
      patches/Bromite/DoH-secure-mode-by-default.patch
  15. 12
      patches/Bromite/Inject-scripts-for-AMP-tracking-ads-and-video.patch
  16. 6
      patches/Bromite/Remove-account-permissions-from-manifest.patch
  17. 10
      patches/Bromite/Revert-flags-remove-disable-pull-to-refresh-effect.patch
  18. 6
      patches/Bromite/updater-disable-updater-pings.patch
  19. 37
      patches/Other/Fix-Note9-startup-crash.patch
  20. 43
      patches/Other/debug-fix.patch
  21. 6
      patches/Unobtainium/kill-GCM.patch
  22. 30
      patches/Unobtainium/kill-Translate.patch
  23. 2
      patches/Unobtainium/kill-Vision.patch
  24. 9
      patches/Vanadium/0003-switch-to-fstack-protector-strong.patch
  25. 2
      patches/Vanadium/0004-enable-fwrapv-in-Clang-for-non-UBSan-builds.patch
  26. 2
      patches/Vanadium/0016-disable-seed-based-field-trials.patch
  27. 12
      patches/Vanadium/0017-disable-fetching-variations.patch
  28. 4
      patches/Vanadium/0018-disable-WebView-variations-support.patch
  29. 13
      patches/Vanadium/0022-disable-metrics-by-default.patch
  30. 9
      patches/Vanadium/0033-disable-media-router-media-remoting-by-default.patch
  31. 14
      patches/Vanadium/0034-disable-media-router-by-default.patch
  32. 2
      patches/Vanadium/0043-enable-split-cache-by-default.patch
  33. 2
      patches/Vanadium/0044-enable-partitioning-connections-by-default.patch
  34. 12
      patches/Vanadium/0050-enable-strict-site-isolation-by-default-on-Android.patch
  35. 11
      patches/Vanadium/0054-always-use-local-new-tab-page.patch
  36. 27
      patches/Vanadium/0076-disable-using-Play-services-fonts.patch
  37. 6
      patches/series
  38. 2
      patches/src-fix/fix-prefs.patch
  39. 163
      patches/src-fix/fix-safe-browsing.patch
  40. 2
      patches/src-fix/fix-search-template.patch
  41. 14
      patches/ungoogled-chromium-android/Add-always-desktop-option.patch
  42. 170
      patches/ungoogled-chromium-android/Add-clear-data-on-exit-flag.patch
  43. 62
      patches/ungoogled-chromium-android/Add-disable-peerconnection-flag.patch
  44. 18
      patches/ungoogled-chromium-android/Add-folder-button-bookmark.patch
  45. 20
      patches/ungoogled-chromium-android/Add-force-tablet-ui-option.patch
  46. 376
      patches/ungoogled-chromium-android/Add-more-search-engines.patch
  47. 6
      patches/ungoogled-chromium-android/Add-save-data-flag.patch
  48. 8
      patches/ungoogled-chromium-android/Add_trichrome_apk.patch
  49. 4
      patches/ungoogled-chromium-android/Change-package-name-chromium.patch
  50. 4
      patches/ungoogled-chromium-android/Disable-contextual-search.patch
  51. 25
      patches/ungoogled-chromium-android/Disable-lite-mode-prompt.patch
  52. 2
      patches/ungoogled-chromium-android/Disable-offline-indicator.patch
  53. 2
      patches/ungoogled-chromium-android/Enable-ProactivelySwapBrowsingInstance.patch
  54. 78
      patches/ungoogled-chromium-android/Remove-UI-elements.patch
  55. 55
      patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.auth.patch
  56. 10
      patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.cast.patch
  57. 20
      patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.common-auth-signin-dynamic-com.google.android.gms.tasks.patch
  58. 73
      patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.fido-com.google.android.gms.iid-com.google.android.gms.instantapps-com.google.android.gms.location.patch
  59. 2
      patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.flags-com.google.android.gms.location.places-com.google.android.gms.stats.patch
  60. 36
      patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.gcm.patch
  61. 27
      patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.vision-com.google.android.gms.clearcut-com.google.android.gms.phenotype.patch
  62. 38
      patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.play.core.splitcompat-com.google.android.play.core.splitinstall.patch
  63. 10
      patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.play.patch
  64. 42
      patches/ungoogled-chromium-android/Remove-dependency-on-firebase.patch

4
.build_config

@ -10,7 +10,7 @@ trichrome_webview_target=trichrome_webview_apk
trichrome_webview_64_target=trichrome_webview_64_apk
all=all
chromium_version=97.0.4692.71
ungoogled_chromium_version=97.0.4692.71
chromium_version=99.0.4844.51
ungoogled_chromium_version=99.0.4844.51
ungoogled_chromium_revision=1
ungoogled_chromium_android_revision=1

7
CHANGELOG.md

@ -1,6 +1,11 @@
# 99.0.4844.51-1
* Add clear data on exit flag
* Add flag to disable WebRTC until a UI can be implemented (See [discussion](https://github.com/ungoogled-software/ungoogled-chromium-android/discussions/116)). This flag is enabled by default
* Add a fix for Note9 on Android 8 (Thanks to @uazo)
# 97.0.4692.71-1
* Upstream update
*
# 96.0.4664.110-1
* Upstream update

1
android_flags.debug.gn

@ -9,7 +9,6 @@ enable_iterator_debugging=false
enable_mdns=false
enable_mse_mpeg2ts_stream_parser=true
enable_nacl=false
enable_nacl_nonsfi=false
enable_one_click_signin=false
enable_reading_list=false
enable_remoting=false

861
domain_sub_2.list

File diff suppressed because it is too large

37
patches/Bromite/AImageReader-CFI-crash-mitigations.patch

@ -22,7 +22,7 @@ See discussions at:
base/android/android_image_reader_compat.h | 4 ++++
chrome/browser/flag-metadata.json | 2 +-
gpu/config/gpu_driver_bug_list.json | 16 ++++++++++++++++
gpu/config/gpu_finch_features.cc | 5 +++++
gpu/config/gpu_finch_features.cc | 4 ++++
gpu/config/gpu_finch_features.h | 1 +
gpu/config/gpu_util.cc | 8 ++++++++
gpu/config/gpu_workaround_list.txt | 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, 62 insertions(+), 3 deletions(-)
--- a/base/android/android_image_reader_compat.cc
+++ b/base/android/android_image_reader_compat.cc
@ -59,7 +59,7 @@ See discussions at:
AndroidImageReader::AndroidImageReader() : is_supported_(LoadFunctions()) {}
--- a/base/android/android_image_reader_compat.h
+++ b/base/android/android_image_reader_compat.h
@@ -25,6 +25,9 @@ class BASE_EXPORT AndroidImageReader {
@@ -24,6 +24,9 @@ class BASE_EXPORT AndroidImageReader {
AndroidImageReader(const AndroidImageReader&) = delete;
AndroidImageReader& operator=(const AndroidImageReader&) = delete;
@ -69,7 +69,7 @@ See discussions at:
// 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.
@@ -62,6 +65,7 @@ class BASE_EXPORT AndroidImageReader {
@@ -61,6 +64,7 @@ class BASE_EXPORT AndroidImageReader {
jobject ANativeWindow_toSurface(JNIEnv* env, ANativeWindow* window);
private:
@ -79,7 +79,7 @@ See discussions at:
AndroidImageReader();
--- a/chrome/browser/flag-metadata.json
+++ b/chrome/browser/flag-metadata.json
@@ -2097,7 +2097,7 @@
@@ -2161,7 +2161,7 @@
{
"name": "enable-image-reader",
"owners": [ "vikassoni", "liberato" ],
@ -115,11 +115,10 @@ See discussions at:
"description": "DXVA video decoder crashes on some AMD GPUs.",
--- a/gpu/config/gpu_finch_features.cc
+++ b/gpu/config/gpu_finch_features.cc
@@ -52,6 +52,11 @@ bool IsDeviceBlocked(const char* field,
@@ -53,6 +53,10 @@ bool IsDeviceBlocked(const char* field,
} // namespace
#if defined(OS_ANDROID)
+
#if BUILDFLAG(IS_ANDROID)
+// Use android AImageReader when playing videos with MediaPlayer.
+const base::Feature kAImageReaderMediaPlayer{"AImageReaderMediaPlayer",
+ base::FEATURE_ENABLED_BY_DEFAULT};
@ -132,15 +131,15 @@ See discussions at:
@@ -17,6 +17,7 @@ namespace features {
// All features in alphabetical order. The features should be documented
// alongside the definition of their values in the .cc file.
#if defined(OS_ANDROID)
#if BUILDFLAG(IS_ANDROID)
+GPU_EXPORT extern const base::Feature kAImageReaderMediaPlayer;
GPU_EXPORT extern const base::Feature kUseGles2ForOopR;
GPU_EXPORT extern const base::Feature kAndroidSurfaceControl;
GPU_EXPORT extern const base::Feature kWebViewSurfaceControl;
--- a/gpu/config/gpu_util.cc
+++ b/gpu/config/gpu_util.cc
@@ -114,6 +114,9 @@ GpuFeatureStatus GetAndroidSurfaceContro
#if !defined(OS_ANDROID)
@@ -116,6 +116,9 @@ GpuFeatureStatus GetAndroidSurfaceContro
#if !BUILDFLAG(IS_ANDROID)
return kGpuFeatureStatusDisabled;
#else
+ if (blocklisted_features.count(GPU_FEATURE_TYPE_ANDROID_SURFACE_CONTROL))
@ -149,7 +148,7 @@ See discussions at:
if (!gpu_preferences.enable_android_surface_control)
return kGpuFeatureStatusDisabled;
@@ -356,6 +359,11 @@ void AdjustGpuFeatureStatusToWorkarounds
@@ -324,6 +327,11 @@ void AdjustGpuFeatureStatusToWorkarounds
gpu_feature_info->status_values[GPU_FEATURE_TYPE_CANVAS_OOP_RASTERIZATION] =
kGpuFeatureStatusBlocklisted;
}
@ -163,19 +162,19 @@ See discussions at:
// Estimates roughly user total disk space by counting in the drives where
--- a/gpu/config/gpu_workaround_list.txt
+++ b/gpu/config/gpu_workaround_list.txt
@@ -14,6 +14,7 @@ decode_encode_srgb_for_generatemipmap
@@ -13,6 +13,7 @@ count_all_in_varyings_packing
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_av1_decode
disable_accelerated_h264_encode
disable_accelerated_vp8_decode
--- a/gpu/ipc/service/gpu_init.cc
+++ b/gpu/ipc/service/gpu_init.cc
@@ -521,6 +521,11 @@ bool GpuInit::InitializeAndStartSandbox(
}
@@ -519,6 +519,11 @@ bool GpuInit::InitializeAndStartSandbox(
}
#endif // defined(OS_MAC)
+ // Disable AImageReader if the workaround is enabled.
+ if (gpu_feature_info_.IsWorkaroundEnabled(DISABLE_AIMAGEREADER)) {
@ -214,7 +213,7 @@ See discussions at:
}
--- a/media/base/media_switches.cc
+++ b/media/base/media_switches.cc
@@ -682,6 +682,10 @@ const base::Feature kMediaDrmPreprovisio
@@ -667,6 +667,10 @@ const base::Feature kMediaDrmPreprovisio
// Note: Has no effect if kMediaDrmPreprovisioning feature is disabled.
const base::Feature kMediaDrmPreprovisioningAtStartup{
"MediaDrmPreprovisioningAtStartup", base::FEATURE_ENABLED_BY_DEFAULT};
@ -227,7 +226,7 @@ See discussions at:
const base::Feature kPictureInPictureAPI{"PictureInPictureAPI",
--- a/media/base/media_switches.h
+++ b/media/base/media_switches.h
@@ -216,6 +216,7 @@ MEDIA_EXPORT extern const base::Feature
@@ -212,6 +212,7 @@ MEDIA_EXPORT extern const base::Feature
MEDIA_EXPORT extern const base::Feature kAllowNonSecureOverlays;
MEDIA_EXPORT extern const base::Feature kMediaControlsExpandGesture;
MEDIA_EXPORT extern const base::Feature kMediaDrmPersistentLicense;

129
patches/Bromite/Add-a-proxy-configuration-page.patch

@ -14,7 +14,7 @@ for SimpleURLLoaders as well.
chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java | 1
chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc | 2
chrome/browser/browser_resources.grd | 6
chrome/browser/net/proxy_service_factory.cc | 23
chrome/browser/net/proxy_service_factory.cc | 24
chrome/browser/net/proxy_service_factory.h | 3
chrome/browser/prefs/browser_prefs.cc | 4
chrome/browser/prefs/chrome_command_line_pref_store.cc | 2
@ -23,8 +23,8 @@ for SimpleURLLoaders as well.
chrome/browser/resources/proxy_config.js | 266 ++++++
chrome/browser/ui/BUILD.gn | 2
chrome/browser/ui/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
components/proxy_config/pref_proxy_config_tracker_impl.cc | 1
@ -33,7 +33,7 @@ for SimpleURLLoaders as well.
components/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, 996 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
@ -67,17 +67,17 @@ for SimpleURLLoaders as well.
android:title="@string/clear_browsing_data_title"
--- 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
@@ -59,6 +59,7 @@ public class PrivacySettings
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";
@@ -52,6 +52,7 @@ import org.chromium.ui.text.SpanApplier;
*/
public class PrivacySettings
extends PreferenceFragmentCompat implements Preference.OnPreferenceChangeListener {
+ private static final String PREF_PROXY_OPTIONS = "proxy";
private static final String PREF_CLOSE_TABS_ON_EXIT = "close_tabs_on_exit";
private static final String PREF_CAN_MAKE_PAYMENT = "can_make_payment";
private static final String PREF_PRELOAD_PAGES = "preload_pages";
private static final String PREF_HTTPS_FIRST_MODE = "https_first_mode";
--- a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc
+++ b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc
@@ -279,6 +279,8 @@ ChromeAutocompleteProviderClient::GetBui
@@ -277,6 +277,8 @@ ChromeAutocompleteProviderClient::GetBui
base::ASCIIToUTF16(chrome::kChromeUISettingsURL));
#endif
builtins_to_provide.push_back(
@ -103,7 +103,15 @@ for SimpleURLLoaders as well.
<include name="IDR_PAGE_NOT_AVAILABLE_FOR_GUEST_APP_HTML" file="resources\page_not_available_for_guest\app.html" type="BINDATA" />
--- a/chrome/browser/net/proxy_service_factory.cc
+++ b/chrome/browser/net/proxy_service_factory.cc
@@ -15,6 +15,9 @@
@@ -6,6 +6,7 @@
#include <utility>
+#include "base/logging.h"
#include "base/task/post_task.h"
#include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h"
@@ -15,6 +16,9 @@
#include "content/public/browser/browser_thread.h"
#include "net/proxy_resolution/configured_proxy_resolution_service.h"
#include "net/proxy_resolution/proxy_config_service.h"
@ -113,14 +121,14 @@ for SimpleURLLoaders as well.
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chromeos/network/proxy/proxy_config_service_impl.h"
@@ -73,7 +76,20 @@ ProxyServiceFactory::CreatePrefProxyConf
@@ -73,7 +77,20 @@ ProxyServiceFactory::CreatePrefProxyConf
return std::make_unique<chromeos::ProxyConfigServiceImpl>(
profile_prefs, local_state_prefs, nullptr);
#else
- return std::make_unique<PrefProxyConfigTrackerImpl>(profile_prefs, nullptr);
+ // Migrate from profile_prefs to local_state_prefs
+ if (local_state_prefs->GetBoolean("proxy_migrated") == false) {
+ const base::DictionaryValue* dict =
+ const base::Value* dict =
+ profile_prefs->GetDictionary(proxy_config::prefs::kProxy);
+
+ LOG(INFO) << "CreatePrefProxyConfigTrackerOfProfile: Migration from profile to local state";
@ -135,7 +143,7 @@ for SimpleURLLoaders as well.
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
}
@@ -89,3 +105,8 @@ ProxyServiceFactory::CreatePrefProxyConf
@@ -89,3 +106,8 @@ ProxyServiceFactory::CreatePrefProxyConf
nullptr);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
}
@ -146,23 +154,23 @@ for SimpleURLLoaders as well.
+}
--- a/chrome/browser/net/proxy_service_factory.h
+++ b/chrome/browser/net/proxy_service_factory.h
@@ -8,6 +8,7 @@
#include <memory>
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_NET_PROXY_SERVICE_FACTORY_H_
#include "base/macros.h"
#include <memory>
+#include "components/prefs/pref_registry_simple.h"
class PrefProxyConfigTracker;
class PrefService;
@@ -42,6 +43,8 @@ class ProxyServiceFactory {
// (ChromeOS only).
static std::unique_ptr<PrefProxyConfigTracker>
CreatePrefProxyConfigTrackerOfLocalState(PrefService* local_state_prefs);
+
+ static void RegisterPrefs(PrefRegistrySimple* registry);
};
@@ -35,6 +36,8 @@ class ProxyServiceFactory {
CreatePrefProxyConfigTrackerOfProfile(PrefService* profile_prefs,
PrefService* local_state_prefs);
#endif // CHROME_BROWSER_NET_PROXY_SERVICE_FACTORY_H_
+ static void RegisterPrefs(PrefRegistrySimple* registry);
+
// Creates a PrefProxyConfigTracker that tracks local state only. This tracker
// should be used for the system request context and the signin screen
// (ChromeOS only).
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -159,6 +159,8 @@
@ -174,18 +182,18 @@ for SimpleURLLoaders as well.
#if BUILDFLAG(ENABLE_BACKGROUND_MODE)
#include "chrome/browser/background/background_mode_manager.h"
#endif
@@ -978,6 +980,8 @@ void RegisterLocalState(PrefRegistrySimp
PluginsResourceService::RegisterPrefs(registry);
#endif
@@ -961,6 +963,8 @@ void RegisterLocalState(PrefRegistrySimp
chrome::enterprise_util::RegisterLocalStatePrefs(registry);
component_updater::RegisterPrefs(registry);
embedder_support::OriginTrialPrefs::RegisterPrefs(registry);
+ ProxyServiceFactory::RegisterPrefs(registry);
+
#if defined(OS_ANDROID)
::android::RegisterPrefs(registry);
enterprise_reporting::RegisterLocalStatePrefs(registry);
ExternalProtocolHandler::RegisterPrefs(registry);
flags_ui::PrefServiceFlagsStorage::RegisterPrefs(registry);
--- a/chrome/browser/prefs/chrome_command_line_pref_store.cc
+++ b/chrome/browser/prefs/chrome_command_line_pref_store.cc
@@ -158,7 +158,7 @@ void ChromeCommandLinePrefStore::ApplyPr
@@ -157,7 +157,7 @@ void ChromeCommandLinePrefStore::ApplyPr
SetValue(
proxy_config::prefs::kProxy,
std::make_unique<base::Value>(ProxyConfigDictionary::CreateFixedServers(
@ -611,7 +619,7 @@ for SimpleURLLoaders as well.
+})();
--- a/chrome/browser/ui/BUILD.gn
+++ b/chrome/browser/ui/BUILD.gn
@@ -280,6 +280,8 @@ static_library("ui") {
@@ -282,6 +282,8 @@ static_library("ui") {
"webui/metrics_handler.h",
"webui/net_export_ui.cc",
"webui/net_export_ui.h",
@ -628,9 +636,9 @@ for SimpleURLLoaders as well.
#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/support_tool_ui.h"
@@ -650,6 +651,8 @@ WebUIFactoryFunction GetWebUIFactoryFunc
@@ -693,6 +694,8 @@ WebUIFactoryFunction GetWebUIFactoryFunc
return &NewWebUI<MemoryInternalsUI>;
if (url.host_piece() == chrome::kChromeUINetExportHost)
return &NewWebUI<NetExportUI>;
@ -641,7 +649,7 @@ for SimpleURLLoaders as well.
if (url.host_piece() == chrome::kChromeUINTPTilesInternalsHost)
--- /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.
+
@ -670,7 +678,6 @@ for SimpleURLLoaders as well.
+#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"
@ -718,6 +725,8 @@ for SimpleURLLoaders as well.
+ 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|.
@ -752,8 +761,6 @@ for SimpleURLLoaders as well.
+ void apply(const net::ProxyConfig& config);
+
+ base::WeakPtrFactory<ProxyConfigMessageHandler> weak_ptr_factory_;
+
+ DISALLOW_COPY_AND_ASSIGN(ProxyConfigMessageHandler);
+};
+
+ProxyConfigMessageHandler::ProxyConfigMessageHandler(Profile *profile)
@ -782,7 +789,7 @@ for SimpleURLLoaders as well.
+ }
+
+ proxy_config_service_ = ProxyServiceFactory::CreateProxyConfigService(
+ pref_proxy_config_tracker_.get(), profile);
+ pref_proxy_config_tracker_.get(), nullptr);
+}
+
+void ProxyConfigMessageHandler::OnProxyConfigChanged(
@ -902,7 +909,7 @@ for SimpleURLLoaders as well.
+ net::ProxyConfigWithAnnotation config;
+ auto availability = proxy_config_service_->GetLatestProxyConfig(&config);
+
+ const base::DictionaryValue* dict =
+ const base::Value* dict =
+ pref_service_->GetDictionary(proxy_config::prefs::kProxy);
+ ProxyConfigDictionary proxy_dict(dict->Clone());
+ ProxyPrefs::ProxyMode mode;
@ -1063,7 +1070,7 @@ for SimpleURLLoaders as well.
+}
--- /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.
+
@ -1084,22 +1091,20 @@ for SimpleURLLoaders as well.
+#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_
--- a/chrome/common/webui_url_constants.cc
+++ b/chrome/common/webui_url_constants.cc
@@ -37,6 +37,8 @@ const char kChromeUICertificateViewerHos
@@ -38,6 +38,8 @@ const char kChromeUICertificateViewerHos
const char kChromeUICertificateViewerURL[] = "chrome://view-cert/";
const char kChromeUIChromeSigninHost[] = "chrome-signin";
const char kChromeUIChromeSigninURL[] = "chrome://chrome-signin/";
@ -1108,7 +1113,7 @@ for SimpleURLLoaders as well.
const char kChromeUIChromeURLsHost[] = "chrome-urls";
const char kChromeUIChromeURLsURL[] = "chrome://chrome-urls/";
const char kChromeUIComponentsHost[] = "components";
@@ -354,6 +356,7 @@ bool IsSystemWebUIHost(base::StringPiece
@@ -397,6 +399,7 @@ bool IsSystemWebUIHost(base::StringPiece
kChromeUIMobileSetupHost,
kChromeUIMultiDeviceSetupHost,
kChromeUINetworkHost,
@ -1116,8 +1121,8 @@ for SimpleURLLoaders as well.
kChromeUIOobeHost,
kChromeUIOSCreditsHost,
kChromeUIOSSettingsHost,
@@ -582,6 +585,7 @@ const char* const kChromeHostURLs[] = {
#if !defined(OS_ANDROID)
@@ -634,6 +637,7 @@ const char* const kChromeHostURLs[] = {
#if !BUILDFLAG(IS_ANDROID)
#if !BUILDFLAG(IS_CHROMEOS_ASH)
kChromeUIAppLauncherPageHost,
+ kChromeUIProxyConfigHost,
@ -1126,7 +1131,7 @@ for SimpleURLLoaders as well.
kChromeUIDownloadsHost,
--- a/chrome/common/webui_url_constants.h
+++ b/chrome/common/webui_url_constants.h
@@ -125,6 +125,8 @@ extern const char kChromeUIMemoryInterna
@@ -129,6 +129,8 @@ extern const char kChromeUIMemoryInterna
extern const char kChromeUINTPTilesInternalsHost[];
extern const char kChromeUINaClHost[];
extern const char kChromeUINetExportHost[];
@ -1240,7 +1245,7 @@ for SimpleURLLoaders as well.
--- a/components/proxy_config/proxy_config_dictionary.h
+++ b/components/proxy_config/proxy_config_dictionary.h
@@ -43,6 +43,7 @@ class PROXY_CONFIG_EXPORT ProxyConfigDic
@@ -42,6 +42,7 @@ class PROXY_CONFIG_EXPORT ProxyConfigDic
bool GetProxyServer(std::string* out) const;
bool GetBypassList(std::string* out) const;
bool HasBypassList() const;
@ -1248,7 +1253,7 @@ for SimpleURLLoaders as well.
const base::Value& GetDictionary() const;
@@ -51,7 +52,8 @@ class PROXY_CONFIG_EXPORT ProxyConfigDic
@@ -50,7 +51,8 @@ class PROXY_CONFIG_EXPORT ProxyConfigDic
static base::Value CreatePacScript(const std::string& pac_url,
bool pac_mandatory);
static base::Value CreateFixedServers(const std::string& proxy_server,
@ -1258,7 +1263,7 @@ for SimpleURLLoaders as well.
static base::Value CreateSystem();
// Encodes the proxy server as "<url-scheme>=<proxy-scheme>://<proxy>".
@@ -67,7 +69,8 @@ class PROXY_CONFIG_EXPORT ProxyConfigDic
@@ -66,7 +68,8 @@ class PROXY_CONFIG_EXPORT ProxyConfigDic
const std::string& pac_url,
bool pac_mandatory,
const std::string& proxy_server,
@ -1304,7 +1309,7 @@ for SimpleURLLoaders as well.
+ std::string proxy_list;
+ for (const ProxyServer& proxy_server :
+ single_proxies.GetAll()) {
+ proxy_list += proxy_server.host_port_pair().ToString() + ";";
+ proxy_list += ProxyServerToProxyUri(proxy_server) + ";";
+ }
+ // remove last semicolon
+ if (proxy_list.length() != 0 ) {
@ -1323,19 +1328,19 @@ for SimpleURLLoaders as well.
+ std::string list;
+ for (const ProxyServer& proxy_server :
+ proxies_for_http.GetAll()) {
+ list += "http=" + proxy_server.host_port_pair().ToString() + ";";
+ list += "http=" + ProxyServerToProxyUri(proxy_server) + ";";
+ }
+ for (const ProxyServer& proxy_server :
+ proxies_for_https.GetAll()) {
+ list += "https=" + proxy_server.host_port_pair().ToString() + ";";
+ list += "https=" + ProxyServerToProxyUri(proxy_server) + ";";
+ }
+ for (const ProxyServer& proxy_server :
+ proxies_for_ftp.GetAll()) {
+ list += "ftp=" + proxy_server.host_port_pair().ToString() + ";";
+ list += "ftp=" + ProxyServerToProxyUri(proxy_server) + ";";
+ }
+ for (const ProxyServer& proxy_server :
+ fallback_proxies.GetAll()) {
+ list += "socks=" + proxy_server.host_port_pair().ToString() + ";";
+ list += "socks=" + ProxyServerToProxyUri(proxy_server) + ";";
+ }
+ if (list.length() != 0 ) {
+ // remove last semicolon

98
patches/Bromite/Add-an-always-incognito-mode.patch

@ -147,7 +147,7 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c
import org.chromium.chrome.browser.IntentHandler.IntentHandlerDelegate;
import org.chromium.chrome.browser.IntentHandler.TabOpenType;
import org.chromium.chrome.browser.accessibility_tab_switcher.OverviewListLayout;
@@ -1769,8 +1770,9 @@ public class ChromeTabbedActivity extend
@@ -1797,8 +1798,9 @@ public class ChromeTabbedActivity extend
Bundle savedInstanceState = getSavedInstanceState();
// We determine the model as soon as possible so every systems get initialized coherently.
@ -161,7 +161,7 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c
--- 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.conte
@@ -102,6 +102,7 @@ import org.chromium.chrome.browser.conte
import org.chromium.chrome.browser.contextualsearch.ContextualSearchManager;
import org.chromium.chrome.browser.contextualsearch.ContextualSearchManager.ContextualSearchTabPromotionDelegate;
import org.chromium.chrome.browser.dependency_injection.ChromeActivityCommonsModule;
@ -169,7 +169,7 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c
import org.chromium.chrome.browser.dependency_injection.ChromeActivityComponent;
import org.chromium.chrome.browser.dependency_injection.ModuleFactoryOverrides;
import org.chromium.chrome.browser.device.DeviceClassManager;
@@ -1985,6 +1986,9 @@ public abstract class ChromeActivity<C e
@@ -2027,6 +2028,9 @@ public abstract class ChromeActivity<C e
throw new IllegalStateException(
"Attempting to access TabCreator before initialization");
}
@ -181,7 +181,7 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c
--- 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
@@ -515,6 +515,12 @@ public class AppMenuPropertiesDelegateIm
@@ -524,6 +524,12 @@ public class AppMenuPropertiesDelegateIm
}
private void prepareCommonMenuItems(Menu menu, @MenuGroup int menuGroup, boolean isIncognito) {
@ -204,7 +204,7 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c
import org.chromium.chrome.browser.compositor.bottombar.ephemeraltab.EphemeralTabCoordinator;
import org.chromium.chrome.browser.contextmenu.ChromeContextMenuItem.Item;
import org.chromium.chrome.browser.contextmenu.ContextMenuCoordinator.ListItemType;
@@ -408,6 +409,10 @@ public class ChromeContextMenuPopulator
@@ -397,6 +398,10 @@ public class ChromeContextMenuPopulator
boolean hasSaveImage = false;
mShowEphemeralTabNewLabel = null;
@ -215,7 +215,7 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c
List<Pair<Integer, ModelList>> groupedItems = new ArrayList<>();
if (mParams.isAnchor()) {
@@ -426,6 +431,7 @@ public class ChromeContextMenuPopulator
@@ -415,6 +420,7 @@ public class ChromeContextMenuPopulator
linkGroup.add(createListItem(Item.OPEN_IN_NEW_TAB_IN_GROUP));
}
}
@ -223,7 +223,7 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c
if (!mItemDelegate.isIncognito() && mItemDelegate.isIncognitoSupported()) {
linkGroup.add(createListItem(Item.OPEN_IN_INCOGNITO_TAB));
}
@@ -450,7 +456,7 @@ public class ChromeContextMenuPopulator
@@ -439,7 +445,7 @@ public class ChromeContextMenuPopulator
}
}
if (FirstRunStatus.getFirstRunFlowComplete()) {
@ -268,8 +268,8 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c
private void recordUserAction() {
--- a/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java
@@ -49,6 +49,9 @@ import org.chromium.components.browser_u
import org.chromium.components.embedder_support.util.UrlConstants;
@@ -49,6 +49,9 @@ import org.chromium.components.embedder_
import org.chromium.components.version_info.VersionInfo;
import org.chromium.device.mojom.ScreenOrientationLockType;
+import org.chromium.base.ContextUtils;
@ -278,7 +278,7 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
@@ -726,7 +729,7 @@ public class CustomTabIntentDataProvider
@@ -731,7 +734,7 @@ public class CustomTabIntentDataProvider
@Override
public boolean isIncognito() {
@ -289,9 +289,9 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c
@Nullable
--- a/chrome/android/java/src/org/chromium/chrome/browser/init/StartupTabPreloader.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/init/StartupTabPreloader.java
@@ -38,6 +38,9 @@ import org.chromium.network.mojom.Referr
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;
@ -299,7 +299,7 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c
/**
* 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.
@@ -349,17 +352,22 @@ public class StartupTabPreloader impleme
@@ -446,17 +449,22 @@ public class StartupTabPreloader impleme
Intent intent = mIntentSupplier.get();
GURL url = UrlFormatter.fixupUrl(getUrlFromIntent(intent));
@ -327,7 +327,7 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c
.setWebContents(webContents)
--- 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
@@ -31,6 +31,10 @@ import org.chromium.chrome.browser.profi
@@ -33,6 +33,10 @@ import org.chromium.chrome.browser.profi
import org.chromium.chrome.browser.settings.ChromeManagedPreferenceDelegate;
import org.chromium.chrome.browser.settings.SettingsLauncherImpl;
import org.chromium.chrome.browser.signin.services.IdentityServicesProvider;
@ -338,7 +338,7 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c
import org.chromium.chrome.browser.sync.settings.GoogleServicesSettings;
import org.chromium.chrome.browser.sync.settings.ManageSyncSettings;
import org.chromium.chrome.browser.usage_stats.UsageStatsConsentDialog;
@@ -48,7 +52,12 @@ import org.chromium.ui.text.SpanApplier;
@@ -51,7 +55,12 @@ import org.chromium.ui.text.SpanApplier;
* Fragment to keep track of the all the privacy related preferences.
*/
public class PrivacySettings
@ -349,10 +349,10 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c
+ private Snackbar mSnackbar;
+
+ private static final String PREF_ALWAYS_INCOGNITO = "always_incognito";
private static final String PREF_PROXY_OPTIONS = "proxy";
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_HTTPS_FIRST_MODE = "https_first_mode";
@@ -97,6 +106,25 @@ public class PrivacySettings
private static final String PREF_PRELOAD_PAGES = "preload_pages";
@@ -105,6 +114,25 @@ public class PrivacySettings
(ChromeSwitchPreference) findPreference(PREF_CAN_MAKE_PAYMENT);
canMakePaymentPref.setOnPreferenceChangeListener(this);
@ -375,22 +375,22 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c
+ /*actionData*/null)
+ .setDuration(/*durationMs*/70000);
+
ChromeSwitchPreference networkPredictionPref =
(ChromeSwitchPreference) findPreference(PREF_NETWORK_PREDICTIONS);
networkPredictionPref.setChecked(
@@ -156,6 +184,9 @@ public class PrivacySettings
} else if (PREF_NETWORK_PREDICTIONS.equals(key)) {
PrivacyPreferencesManagerImpl.getInstance().setNetworkPredictionEnabled(
(boolean) newValue);
Preference preloadPagesPreference = findPreference(PREF_PRELOAD_PAGES);
preloadPagesPreference.setSummary(
PreloadPagesSettingsFragment.getPreloadPagesSummaryString(getContext()));
@@ -162,6 +190,9 @@ public class PrivacySettings
} else if (PREF_CAN_MAKE_PAYMENT.equals(key)) {
UserPrefs.get(Profile.getLastUsedRegularProfile())
.setBoolean(Pref.CAN_MAKE_PAYMENT_ENABLED, (boolean) newValue);
+ } else if (PREF_ALWAYS_INCOGNITO.equals(key)) {
+ if (!mSnackbarManager.isShowing())
+ mSnackbarManager.showSnackbar(mSnackbar);
} else if (PREF_HTTPS_FIRST_MODE.equals(key)) {
UserPrefs.get(Profile.getLastUsedRegularProfile())
.setBoolean(Pref.HTTPS_ONLY_MODE_ENABLED, (boolean) newValue);
@@ -255,4 +286,8 @@ public class PrivacySettings
}
return false;
@@ -267,4 +298,8 @@ public class PrivacySettings
public void setBottomSheetController(BottomSheetController controller) {
mBottomSheetController = controller;
}
+
+ public void setSnackbarManager(SnackbarManager manager) {
@ -399,15 +399,15 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c
}
--- a/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java
@@ -52,6 +52,7 @@ import org.chromium.chrome.browser.safet
@@ -56,6 +56,7 @@ import org.chromium.chrome.browser.safet
import org.chromium.chrome.browser.search_engines.settings.SearchEngineSettings;
import org.chromium.chrome.browser.signin.SyncConsentActivityLauncherImpl;
import org.chromium.chrome.browser.site_settings.ChromeSiteSettingsDelegate;
+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;
@@ -172,6 +173,9 @@ public class SettingsActivity extends Ch
import org.chromium.components.browser_ui.bottomsheet.BottomSheetController;
@@ -241,6 +242,9 @@ public class SettingsActivity extends Ch
.getSiteSettingsDelegate());
delegate.setSnackbarManager(mSnackbarManager);
}
@ -419,9 +419,9 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c
@Override
--- a/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreator.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreator.java
@@ -44,6 +44,10 @@ import org.chromium.url.GURL;
import java.nio.ByteBuffer;
@@ -43,6 +43,10 @@ import org.chromium.ui.base.PageTransiti
import org.chromium.ui.base.WindowAndroid;
import org.chromium.url.GURL;
+import org.chromium.base.ContextUtils;
+import org.chromium.chrome.browser.AlwaysIncognitoLinkInterceptor;
@ -430,7 +430,7 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c
/**
* This class creates various kinds of new tabs and adds them to the right {@link TabModel}.
*/
@@ -74,6 +78,7 @@ public class ChromeTabCreator extends Ta
@@ -73,6 +77,7 @@ public class ChromeTabCreator extends Ta
private final Activity mActivity;
private final StartupTabPreloader mStartupTabPreloader;
private final boolean mIncognito;
@ -438,7 +438,7 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c
private WindowAndroid mNativeWindow;
private TabModel mTabModel;
@@ -96,6 +101,10 @@ public class ChromeTabCreator extends Ta
@@ -95,6 +100,10 @@ public class ChromeTabCreator extends Ta
mNativeWindow = nativeWindow;
mTabDelegateFactorySupplier = tabDelegateFactory;
mIncognito = incognito;
@ -449,7 +449,7 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c
mOverviewNTPCreator = overviewNTPCreator;
mAsyncTabParamsManager = asyncTabParamsManager;
mTabModelSelectorSupplier = tabModelSelectorSupplier;
@@ -259,6 +268,8 @@ public class ChromeTabCreator extends Ta
@@ -262,6 +271,8 @@ public class ChromeTabCreator extends Ta
if (creationState == TabCreationState.LIVE_IN_FOREGROUND && !openInForeground) {
creationState = TabCreationState.LIVE_IN_BACKGROUND;
}
@ -458,7 +458,7 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c
mTabModel.addTab(tab, position, type, creationState);
return tab;
} finally {
@@ -293,6 +304,8 @@ public class ChromeTabCreator extends Ta
@@ -296,6 +307,8 @@ public class ChromeTabCreator extends Ta
@TabCreationState
int creationState = openInForeground ? TabCreationState.LIVE_IN_FOREGROUND
: TabCreationState.LIVE_IN_BACKGROUND;
@ -467,7 +467,7 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c
mTabModel.addTab(tab, position, type, creationState);
return true;
}
@@ -333,7 +346,6 @@ public class ChromeTabCreator extends Ta
@@ -336,7 +349,6 @@ public class ChromeTabCreator extends Ta
// TODO(crbug.com/1081924): Clean up the launches from SearchActivity/Chrome.
public Tab launchUrlFromExternalApp(
LoadUrlParams loadUrlParams, String appId, boolean forceNewTab, Intent intent) {
@ -475,7 +475,7 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c
// Don't re-use tabs for intents from Chrome. Note that this can be spoofed so shouldn't be
// relied on for anything security sensitive.
boolean isLaunchedFromChrome = TextUtils.equals(appId, mActivity.getPackageName());
@@ -428,6 +440,8 @@ public class ChromeTabCreator extends Ta
@@ -432,6 +444,8 @@ public class ChromeTabCreator extends Ta
.setSerializedCriticalPersistedTabData(serializedCriticalPersistedTabData)
.build();
}
@ -494,7 +494,7 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c
import org.chromium.base.Log;
import org.chromium.base.ObserverList;
import org.chromium.base.StreamUtil;
@@ -55,6 +56,8 @@ import org.chromium.content_public.brows
@@ -58,6 +59,8 @@ import org.chromium.content_public.brows
import org.chromium.content_public.browser.UiThreadTaskTraits;
import org.chromium.url.GURL;
@ -503,7 +503,7 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c
import java.io.BufferedInputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -643,6 +646,13 @@ public class TabPersistentStore {
@@ -722,6 +725,13 @@ public class TabPersistentStore {
}
}
}
@ -519,7 +519,7 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c
if (model.isIncognito() != isIncognito) {
--- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappIntentDataProvider.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappIntentDataProvider.java
@@ -29,6 +29,9 @@ import org.chromium.chrome.browser.flags
@@ -32,6 +32,9 @@ import org.chromium.chrome.browser.flags
import org.chromium.components.browser_ui.widget.TintedDrawable;
import org.chromium.device.mojom.ScreenOrientationLockType;
@ -529,7 +529,7 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c
/**
* Stores info about a web app.
*/
@@ -42,6 +45,8 @@ public class WebappIntentDataProvider ex
@@ -45,6 +48,8 @@ public class WebappIntentDataProvider ex
private final Intent mIntent;
private final ColorProviderImpl mColorProvider;
@ -538,7 +538,7 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c
/**
* Returns the toolbar color to use if a custom color is not specified by the webapp.
*/
@@ -63,6 +68,10 @@ public class WebappIntentDataProvider ex
@@ -67,6 +72,10 @@ public class WebappIntentDataProvider ex
mWebappExtras = webappExtras;
mWebApkExtras = webApkExtras;
mActivityType = (webApkExtras != null) ? ActivityType.WEB_APK : ActivityType.WEBAPP;
@ -549,7 +549,7 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c
}
@Override
@@ -152,6 +161,11 @@ public class WebappIntentDataProvider ex
@@ -156,6 +165,11 @@ public class WebappIntentDataProvider ex
}
@Override
@ -563,7 +563,7 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c
}
--- a/chrome/browser/flags/android/chrome_feature_list.cc
+++ b/chrome/browser/flags/android/chrome_feature_list.cc
@@ -460,7 +460,7 @@ const base::Feature kCCTIncognito{"CCTIn
@@ -470,7 +470,7 @@ const base::Feature kCCTIncognito{"CCTIn
base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kCCTIncognitoAvailableToThirdParty{
@ -574,7 +574,7 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c
base::FEATURE_ENABLED_BY_DEFAULT};
--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
@@ -954,6 +954,19 @@ Your Google account may have other forms
@@ -983,6 +983,19 @@ Your Google account may have other forms
<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>

114
patches/Bromite/Add-bookmark-import-export-actions.patch

@ -220,10 +220,10 @@ Completely remove contacts picker permission from the file dialog
getMenu().findItem(R.id.search_menu_id).setVisible(false);
getMenu().findItem(R.id.edit_menu_id).setVisible(false);
getMenu().findItem(R.id.add_folder_menu_id).setVisible(false);
@@ -181,6 +191,8 @@ public class BookmarkActionBar extends S
@@ -180,6 +190,8 @@ public class BookmarkActionBar extends S
@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);
@ -322,7 +322,7 @@ Completely remove contacts picker permission from the file dialog
import android.text.TextUtils;
import android.util.Pair;
@@ -32,8 +45,33 @@ import org.chromium.components.url_forma
@@ -41,10 +54,35 @@ import org.chromium.components.url_forma
import org.chromium.content_public.browser.WebContents;
import org.chromium.url.GURL;
@ -351,12 +351,14 @@ Completely remove contacts picker permission from the file dialog
+import org.chromium.base.task.AsyncTask;
+
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
+import java.io.File;
/**
* Provides the communication channel for Android to fetch and manipulate the
@@ -616,6 +654,211 @@ public class BookmarkBridge {
@@ -739,6 +777,211 @@ public class BookmarkBridge {
}
/**
@ -568,7 +570,7 @@ Completely remove contacts picker permission from the file dialog
* Synchronously gets a list of bookmarks that match the specified search query.
* @param query Keyword used for searching bookmarks.
* @param maxNumberOfResult Maximum number of result to fetch.
@@ -1133,6 +1376,39 @@ public class BookmarkBridge {
@@ -1320,6 +1563,39 @@ public class BookmarkBridge {
depthList.add(depth);
}
@ -608,7 +610,7 @@ Completely remove contacts picker permission from the file dialog
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++) {
@@ -1203,6 +1479,9 @@ public class BookmarkBridge {
@@ -1390,6 +1666,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);
@ -639,7 +641,7 @@ Completely remove contacts picker permission from the file dialog
void closeSearchUI();
--- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkManager.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkManager.java
@@ -33,6 +33,8 @@ import org.chromium.components.browser_u
@@ -35,6 +35,8 @@ import org.chromium.components.browser_u
import org.chromium.components.browser_ui.widget.dragreorder.DragStateDelegate;
import org.chromium.components.browser_ui.widget.selectable_list.SelectableListLayout;
import org.chromium.components.browser_ui.widget.selectable_list.SelectableListToolbar.SearchDelegate;
@ -648,7 +650,7 @@ Completely remove contacts picker permission from the file dialog
import org.chromium.components.browser_ui.widget.selectable_list.SelectionDelegate;
import org.chromium.components.favicon.LargeIconBridge;
import org.chromium.url.GURL;
@@ -55,6 +57,8 @@ public class BookmarkManager
@@ -57,6 +59,8 @@ public class BookmarkManager
private ComponentName mOpenBookmarkComponentName;
private ViewGroup mMainView;
private BookmarkModel mBookmarkModel;
@ -657,7 +659,7 @@ Completely remove contacts picker permission from the file dialog
private BookmarkUndoController mUndoController;
private final ObserverList<BookmarkUIObserver> mUIObservers = new ObserverList<>();
private BasicNativePage mNativePage;
@@ -342,6 +346,14 @@ public class BookmarkManager
@@ -353,6 +357,14 @@ public class BookmarkManager
}
/**
@ -672,7 +674,7 @@ Completely remove contacts picker permission from the file dialog
* @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
* return the url previously set by {@link #updateForUrl(String)}.
@@ -522,6 +534,16 @@ public class BookmarkManager
@@ -533,6 +545,16 @@ public class BookmarkManager
}
@Override
@ -775,8 +777,8 @@ Completely remove contacts picker permission from the file dialog
protected NativePage buildDownloadsPage(Tab tab) {
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -1872,6 +1872,13 @@ static_library("browser") {
"window_placement/window_placement_permission_context.h",
@@ -1854,6 +1854,13 @@ static_library("browser") {
"webid/federated_identity_sharing_permission_context_factory.h",
]
+ if (is_android) {
@ -789,7 +791,7 @@ Completely remove contacts picker permission from the file dialog
configs += [
"//build/config/compiler:wexit_time_destructors",
"//build/config:precompiled_headers",
@@ -3010,6 +3017,8 @@ static_library("browser") {
@@ -3021,6 +3028,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",
@ -800,9 +802,9 @@ Completely remove contacts picker permission from the file dialog
"chrome_browser_field_trials_mobile.cc",
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -7743,6 +7743,12 @@ const FeatureEntry kFeatureEntries[] = {
FEATURE_VALUE_TYPE(ash::features::kDesksTemplates)},
#endif
@@ -7748,6 +7748,12 @@ const FeatureEntry kFeatureEntries[] = {
FEATURE_VALUE_TYPE(chrome::android::kCloseAllTabsModalDialog)},
#endif // BUILDFLAG(IS_ANDROID)
+ {"export-bookmarks-use-saf",
+ flag_descriptions::kBookmarksExportUseSafName,
@ -815,15 +817,15 @@ Completely remove contacts picker permission from the file dialog
// Histograms" in tools/metrics/histograms/README.md (run the
--- a/chrome/browser/android/bookmarks/bookmark_bridge.cc
+++ b/chrome/browser/android/bookmarks/bookmark_bridge.cc
@@ -43,6 +43,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"
@@ -28,6 +28,7 @@
#include "chrome/browser/android/reading_list/reading_list_manager_factory.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/bookmarks/managed_bookmark_service_factory.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"
@@ -52,6 +53,24 @@
#include "chrome/browser/commerce/commerce_feature_list.h"
#include "chrome/browser/optimization_guide/optimization_guide_keyed_service.h"
#include "chrome/browser/optimization_guide/optimization_guide_keyed_service_factory.h"
@@ -56,6 +57,24 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/web_contents.h"
@ -848,7 +850,7 @@ Completely remove contacts picker permission from the file dialog
using base::android::AttachCurrentThread;
using base::android::ConvertUTF8ToJavaString;
using base::android::ConvertUTF16ToJavaString;
@@ -68,8 +87,92 @@ using bookmarks::BookmarkNode;
@@ -72,8 +91,92 @@ using bookmarks::BookmarkNode;
using bookmarks::BookmarkType;
using content::BrowserThread;
@ -941,7 +943,7 @@ Completely remove contacts picker permission from the file dialog
class BookmarkTitleComparer {
public:
explicit BookmarkTitleComparer(BookmarkBridge* bookmark_bridge,
@@ -154,6 +257,10 @@ BookmarkBridge::~BookmarkBridge() {
@@ -160,6 +263,10 @@ BookmarkBridge::~BookmarkBridge() {
if (partner_bookmarks_shim_)
partner_bookmarks_shim_->RemoveObserver(this);
reading_list_manager_->RemoveObserver(this);
@ -952,7 +954,7 @@ Completely remove contacts picker permission from the file dialog
}
void BookmarkBridge::Destroy(JNIEnv*, const JavaParamRef<jobject>&) {
@@ -571,6 +678,182 @@ jint BookmarkBridge::GetTotalBookmarkCou
@@ -577,6 +684,182 @@ jint BookmarkBridge::GetTotalBookmarkCou
return count;
}
@ -1137,7 +1139,7 @@ Completely remove contacts picker permission from the file dialog
jlong id,
--- 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"
@ -1145,7 +1147,7 @@ Completely remove contacts picker permission from the file dialog
#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"
@ -1155,7 +1157,7 @@ Completely remove contacts picker permission from the file dialog
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,
@ -1165,7 +1167,7 @@ Completely remove contacts picker permission from the file dialog
public:
BookmarkBridge(JNIEnv* env,
const base::android::JavaRef<jobject>& obj,
@@ -59,6 +64,12 @@ class BookmarkBridge : public bookmarks:
@@ -62,6 +67,12 @@ class BookmarkBridge : public bookmarks:
bool IsDoingExtensiveChanges(JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj);
@ -1178,7 +1180,7 @@ Completely remove contacts picker permission from the file dialog
jboolean IsEditBookmarksEnabled(JNIEnv* env);
void LoadEmptyPartnerBookmarkShimForTesting(
@@ -156,6 +167,15 @@ class BookmarkBridge : public bookmarks:
@@ -159,6 +170,15 @@ class BookmarkBridge : public bookmarks:
jlong id,
jint type);
@ -1194,15 +1196,15 @@ Completely remove contacts picker permission from the file dialog
void SetBookmarkTitle(JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj,
jlong id,
@@ -359,12 +379,15 @@ class BookmarkBridge : public bookmarks:
@@ -381,12 +401,15 @@ class BookmarkBridge : public bookmarks:
void DestroyJavaObject();
Profile* profile_;
raw_ptr<Profile> profile_;
+ base::FilePath export_path_;
+ BookmarksExportObserver* observer_; // weak
+ raw_ptr<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_;
@ -1210,10 +1212,10 @@ Completely remove contacts picker permission from the file dialog
// Information about the Partner bookmarks (must check for IsLoaded()).
// This is owned by profile.
@@ -375,6 +398,10 @@ class BookmarkBridge : public bookmarks:
// Observes the profile destruction and creation.
base::ScopedObservation<Profile, ProfileObserver> profile_observation_{this};
@@ -404,6 +427,10 @@ class BookmarkBridge : public bookmarks:
// Weak pointers for creating callbacks that won't call into a destroyed
// object.
base::WeakPtrFactory<BookmarkBridge> weak_ptr_factory_;
+
+ const std::string FileSelectedImpl(const base::FilePath& path);
+ void FileSelectedImplOnUIThread(const base::FilePath& path,
@ -1329,7 +1331,7 @@ Completely remove contacts picker permission from the file dialog
// name conflict or disk error or if Incognito download warning is needed.
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -5467,6 +5467,11 @@ const char kWebKioskEnableLacrosDescript
@@ -5529,6 +5529,11 @@ const char kWebKioskEnableLacrosDescript
"Chrome OS. When disabled, the Ash-chrome will be used";
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
@ -1343,7 +1345,7 @@ Completely remove contacts picker permission from the file dialog
// alphabetical order just like the header file.
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -3193,6 +3193,9 @@ extern const char kWebKioskEnableLacrosN
@@ -3218,6 +3218,9 @@ extern const char kWebKioskEnableLacrosN
extern const char kWebKioskEnableLacrosDescription[];
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
@ -1355,15 +1357,15 @@ Completely remove contacts picker permission from the file dialog
// alphabetical order. See top instructions for more.
--- a/chrome/browser/flags/android/chrome_feature_list.cc
+++ b/chrome/browser/flags/android/chrome_feature_list.cc
@@ -177,6 +177,7 @@ const base::Feature* const kFeaturesExpo
@@ -169,6 +169,7 @@ const base::Feature* const kFeaturesExpo
&kAppToWebAttribution,
&kBackgroundThreadPool,
&kBentoOffline,
&kBookmarkBottomSheet,
+ &kBookmarksExportUseSaf,
&kCastDeviceFilter,
&kCloseAllTabsModalDialog,
&kCloseTabSuggestions,
&kCriticalPersistedTabData,
@@ -829,6 +830,10 @@ const base::Feature kWebApkInstallComple
@@ -860,6 +861,10 @@ const base::Feature kWebApkInstallComple
const base::Feature kWebApkTrampolineOnInitialIntent{
"WebApkTrampolineOnInitialIntent", base::FEATURE_ENABLED_BY_DEFAULT};
@ -1376,7 +1378,7 @@ Completely remove contacts picker permission from the file dialog
const JavaParamRef<jstring>& jfeature_name) {
--- a/chrome/browser/flags/android/chrome_feature_list.h
+++ b/chrome/browser/flags/android/chrome_feature_list.h
@@ -149,6 +149,7 @@ extern const base::Feature kToolbarMicIp
@@ -159,6 +159,7 @@ extern const base::Feature kToolbarMicIp
extern const base::Feature kToolbarUseHardwareBitmapDraw;
extern const base::Feature kTrustedWebActivityLocationDelegation;
extern const base::Feature kTrustedWebActivityNewDisclosure;
@ -1386,7 +1388,7 @@ Completely remove contacts picker permission from the file dialog
extern const base::Feature kTrustedWebActivityQualityEnforcementForced;
--- 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
@@ -541,6 +541,7 @@ public abstract class ChromeFeatureList
@@ -534,6 +534,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";
@ -1431,7 +1433,7 @@ Completely remove contacts picker permission from the file dialog
--- 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"
@ -1452,7 +1454,7 @@ Completely remove contacts picker permission from the file dialog
// Adds the TemplateURLs in |template_urls| to the local store.
--- 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
@@ -122,6 +122,8 @@ public final class ChromePreferenceKeys
@@ -101,6 +101,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";
@ -1461,8 +1463,8 @@ Completely remove contacts picker permission from the file dialog
/**
* Whether Chrome is set as the default browser.
@@ -1052,6 +1054,7 @@ public final class ChromePreferenceKeys
AUTOFILL_ASSISTANT_PROACTIVE_HELP,
@@ -1067,6 +1069,7 @@ public final class ChromePreferenceKeys
ATTRIBUTION_PROVIDER_LAST_BROWSER_START,
APP_LAUNCH_LAST_KNOWN_ACTIVE_TAB_STATE,
APP_LAUNCH_SEARCH_ENGINE_HAD_LOGO,
+ BOOKMARKS_LAST_EXPORT_URI,
@ -1498,7 +1500,7 @@ Completely remove contacts picker permission from the file dialog
</message>
--- a/chrome/common/BUILD.gn
+++ b/chrome/common/BUILD.gn
@@ -416,6 +416,9 @@ static_library("common") {
@@ -383,6 +383,9 @@ static_library("common") {
sources += [
"media/chrome_media_drm_bridge_client.cc",
"media/chrome_media_drm_bridge_client.h",
@ -1519,7 +1521,7 @@ Completely remove contacts picker permission from the file dialog
"importer/bookmarks_file_importer.cc",
"importer/bookmarks_file_importer.h",
"importer/external_process_importer_bridge.cc",
@@ -185,6 +183,11 @@ static_library("utility") {
@@ -189,6 +187,11 @@ static_library("utility") {
}
}
@ -1745,7 +1747,7 @@ Completely remove contacts picker permission from the file dialog
--- a/ui/shell_dialogs/select_file_dialog_android.h
+++ b/ui/shell_dialogs/select_file_dialog_android.h
@@ -58,6 +58,8 @@ class SelectFileDialogImpl : public Sele
@@ -57,6 +57,8 @@ class SelectFileDialogImpl : public Sele
gfx::NativeWindow owning_window,
void* params) override;

35
patches/Bromite/Add-exit-menu-item.patch

@ -5,15 +5,15 @@ Subject: Add exit menu item
Corrected Exit functionality
---
chrome/android/java/res/menu/main_menu.xml | 6 ++++++
chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java | 4 ++++
chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java | 6 ++++++
chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java | 2 ++
chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java | 1 +
chrome/android/java/src/org/chromium/chrome/browser/init/ChromeLifetimeController.java | 6 +++++-
chrome/browser/ui/android/strings/android_chrome_strings.grd | 3 +++
5 files changed, 24 insertions(+), 1 deletion(-)
5 files changed, 17 insertions(+), 1 deletion(-)
--- a/chrome/android/java/res/menu/main_menu.xml
+++ b/chrome/android/java/res/menu/main_menu.xml
@@ -144,6 +144,9 @@
@@ -150,6 +150,9 @@
android:icon="@drawable/gm_filled_cardboard_24" />
<item android:id="@+id/managed_by_menu_id"
android:title="@string/managed" />
@ -23,7 +23,7 @@ Corrected Exit functionality
</group>
<!-- Items shown only in the tab switcher -->
@@ -170,6 +173,9 @@
@@ -176,6 +179,9 @@
<item android:id="@id/preferences_id"
android:title="@string/menu_settings"
android:icon="@drawable/settings_cog" />
@ -35,7 +35,7 @@ Corrected Exit functionality
<!-- Items shown only when the tablet has no visible tabs -->
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
@@ -212,6 +212,8 @@ import java.util.HashSet;
@@ -213,6 +213,8 @@ import java.util.HashSet;
import java.util.List;
import java.util.Locale;
@ -44,15 +44,6 @@ Corrected Exit functionality
/**
* 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.
@@ -2038,6 +2040,8 @@ public class ChromeTabbedActivity extend
} else if (id == R.id.close_tab) {
getCurrentTabModel().closeTab(currentTab, true, false, true);
RecordUserAction.record("MobileTabClosed");
+ } else if (id == R.id.exit_id) {
+ ApplicationLifetime.terminate(false);
} else if (id == R.id.close_all_tabs_menu_id) {
// Close both incognito and normal tabs
getTabModelSelector().closeAllTabs();
--- a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
@@ -65,6 +65,7 @@ import org.chromium.chrome.R;
@ -63,18 +54,6 @@ Corrected Exit functionality
import org.chromium.chrome.browser.ChromeActivitySessionTracker;
import org.chromium.chrome.browser.ChromeApplicationImpl;
import org.chromium.chrome.browser.ChromeKeyboardVisibilityDelegate;
@@ -2421,6 +2422,11 @@ public abstract class ChromeActivity<C e
return true;
}
+ if (id == R.id.exit_id) {
+ ApplicationLifetime.terminate(false);
+ return true;
+ }
+
if (id == R.id.update_menu_id) {
UpdateMenuItemHelper.getInstance().onMenuItemClicked(this);
return true;
--- a/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeLifetimeController.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/init/ChromeLifetimeController.java
@@ -82,7 +82,11 @@ class ChromeLifetimeController implement
@ -92,7 +71,7 @@ Corrected Exit functionality
@Override
--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
@@ -3261,6 +3261,9 @@ To change this setting, <ph name="BEGIN_
@@ -3404,6 +3404,9 @@ To change this setting, <ph name="BEGIN_
<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>

10
patches/Bromite/Add-flag-to-disable-WebGL.patch

@ -10,7 +10,7 @@ Subject: Add flag to disable WebGL
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -2772,6 +2772,9 @@ const FeatureEntry kFeatureEntries[] = {
@@ -2687,6 +2687,9 @@ const FeatureEntry kFeatureEntries[] = {
#include "chrome/browser/bromite_flag_entries.h"
#include "chrome/browser/ungoogled_platform_flag_entries.h"
// Include generated flags for flag unexpiry; see //docs/flag_expiry.md and
@ -22,7 +22,7 @@ Subject: Add flag to disable WebGL
#include "chrome/browser/unexpire_flags_gen.inc"
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -678,6 +678,9 @@ const char kDocumentTransitionSlowdownFa
@@ -680,6 +680,9 @@ const char kDocumentTransitionSlowdownFa
const char kDocumentTransitionSlowdownFactorDescription[] =
"Slows down animations triggered by documentTransition JavaScript API for "
"debugging.";
@ -30,11 +30,11 @@ Subject: Add flag to disable 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";
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -377,6 +377,9 @@ extern const char kForceColorProfileSRGB
@@ -375,6 +375,9 @@ extern const char kForceColorProfileSRGB
extern const char kForceColorProfileP3[];
extern const char kForceColorProfileColorSpin[];
extern const char kForceColorProfileSCRGBLinear[];

18
patches/Bromite/Add-option-to-not-persist-tabs-across-sessions.patch

@ -25,7 +25,7 @@ Subject: Add option to not persist tabs across sessions
android:key="do_not_track"
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
@@ -1181,8 +1181,10 @@ public class ChromeTabbedActivity extend
@@ -1205,8 +1205,10 @@ public class ChromeTabbedActivity extend
boolean hadCipherData =
CipherFactory.getInstance().restoreFromBundle(getSavedInstanceState());
@ -47,7 +47,7 @@ Subject: Add option to not persist tabs across sessions
import android.os.Bundle;
import android.text.SpannableString;
import android.view.Menu;
@@ -15,6 +16,8 @@ import androidx.preference.Preference;
@@ -16,6 +17,8 @@ import androidx.preference.Preference;
import androidx.preference.PreferenceFragmentCompat;
import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat;
@ -56,16 +56,16 @@ Subject: Add option to not persist tabs across sessions
import org.chromium.chrome.R;
import org.chromium.chrome.browser.feedback.HelpAndFeedbackLauncherImpl;
import org.chromium.chrome.browser.flags.ChromeFeatureList;
@@ -57,6 +60,8 @@ public class PrivacySettings
private static final String PREF_PRIVACY_REVIEW = "privacy_review";
@@ -61,6 +64,8 @@ public class PrivacySettings
private static final String PREF_INCOGNITO_LOCK = "incognito_lock";
private static final String PREF_PHONE_AS_A_SECURITY_KEY = "phone_as_a_security_key";
+ private static final String PREF_CLOSE_TABS_ON_EXIT = "close_tabs_on_exit";
+
private ManagedPreferenceDelegate mManagedPreferenceDelegate;
private IncognitoLockSettings mIncognitoLockSettings;
@@ -140,7 +145,11 @@ public class PrivacySettings
private ViewGroup mDialogContainer;
@@ -149,7 +154,11 @@ public class PrivacySettings
@Override
public boolean onPreferenceChange(Preference preference, Object newValue) {
String key = preference.getKey();
@ -77,8 +77,8 @@ Subject: Add option to not persist tabs across sessions
+ } 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)) {
@@ -209,6 +218,11 @@ public class PrivacySettings
} else if (PREF_HTTPS_FIRST_MODE.equals(key)) {
@@ -215,6 +224,11 @@ public class PrivacySettings
PrivacySandboxSettingsFragment.getStatusString(getContext()));
}
@ -92,7 +92,7 @@ Subject: Add option to not persist tabs across sessions
--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
@@ -4168,6 +4168,12 @@ To change this setting, <ph name="BEGIN_
@@ -4350,6 +4350,12 @@ To change this setting, <ph name="BEGIN_
<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>

30
patches/Bromite/Change-default-webRTC-policy-to-not-use-any-address.patch

@ -1,30 +0,0 @@
From: csagan5 <[email protected]>
Date: Sat, 9 May 2020 14:42:37 +0200
Subject: Change default webRTC policy to not use any address
This prevents leakage of the local IP address.
See also: https://github.com/bromite/bromite/issues/553
---
third_party/blink/renderer/modules/peerconnection/peer_connection_dependency_factory.cc | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
--- a/third_party/blink/renderer/modules/peerconnection/peer_connection_dependency_factory.cc
+++ b/third_party/blink/renderer/modules/peerconnection/peer_connection_dependency_factory.cc
@@ -796,12 +796,13 @@ PeerConnectionDependencyFactory::CreateP
port_config.enable_nonproxied_udp = false;
break;
case DEFAULT:
- port_config.enable_multiple_routes = true;
- port_config.enable_nonproxied_udp = true;
+ port_config.enable_multiple_routes = false;
+ port_config.enable_nonproxied_udp = false;
+ port_config.enable_default_local_candidate = false;
break;
}
- VLOG(3) << "WebRTC routing preferences: "
+ LOG(INFO) << "WebRTC routing preferences: "
<< "policy: " << policy
<< ", multiple_routes: " << port_config.enable_multiple_routes
<< ", nonproxied_udp: " << port_config.enable_nonproxied_udp

2
patches/Bromite/Disable-DRM-media-origin-IDs-preprovisioning.patch

@ -8,7 +8,7 @@ Subject: Disable DRM media origin IDs preprovisioning
--- a/media/base/media_switches.cc
+++ b/media/base/media_switches.cc
@@ -674,7 +674,7 @@ const base::Feature kMediaDrmPersistentL
@@ -659,7 +659,7 @@ const base::Feature kMediaDrmPersistentL
// MediaDrmBridge. If disabled, MediaDrmBridge will get unprovisioned origin IDs
// which will trigger provisioning process after MediaDrmBridge is created.
const base::Feature kMediaDrmPreprovisioning{"MediaDrmPreprovisioning",

13
patches/Bromite/DoH-secure-mode-by-default.patch

@ -3,13 +3,13 @@ Date: Sat, 26 Sep 2020 14:23:19 +0100
Subject: DoH secure mode by default
---
.../browser/net/stub_resolver_config_reader.cc | 17 +----------------
1 file changed, 1 insertion(+), 16 deletions(-)
chrome/browser/enterprise/util/android/java/src/org/chromium/chrome/browser/enterprise/util/EnterpriseInfo.java | 2 -
chrome/browser/net/stub_resolver_config_reader.cc | 17 ----------
2 files changed, 2 insertions(+), 17 deletions(-)
diff --git a/chrome/browser/net/stub_resolver_config_reader.cc b/chrome/browser/net/stub_resolver_config_reader.cc
--- a/chrome/browser/net/stub_resolver_config_reader.cc
+++ b/chrome/browser/net/stub_resolver_config_reader.cc
@@ -154,7 +154,7 @@ StubResolverConfigReader::StubResolverConfigReader(PrefService* local_state,
@@ -155,7 +155,7 @@ StubResolverConfigReader::StubResolverCo
if (entries.count("[email protected]")) {
// The user has "Enabled" selected.
local_state_->SetString(prefs::kDnsOverHttpsMode,
@ -18,7 +18,7 @@ diff --git a/chrome/browser/net/stub_resolver_config_reader.cc b/chrome/browser/
} else if (entries.count("[email protected]")) {
// The user has "Disabled" selected.
local_state_->SetString(prefs::kDnsOverHttpsMode,
@@ -334,22 +334,7 @@ SecureDnsConfig StubResolverConfigReader::GetAndUpdateConfiguration(
@@ -335,22 +335,7 @@ SecureDnsConfig StubResolverConfigReader
check_parental_controls = false;
}
@ -52,6 +52,3 @@ diff --git a/chrome/browser/net/stub_resolver_config_reader.cc b/chrome/browser/
/** A simple tuple to hold onto named fields about the state of ownership. */
public static class OwnedState {
--
2.20.1

12
patches/Bromite/Inject-scripts-for-AMP-tracking-ads-and-video.patch

@ -31,15 +31,15 @@ Send a random key press to circumvent idle status detection
"id_target_observer_registry.cc",
--- a/third_party/blink/renderer/core/dom/document.cc
+++ b/third_party/blink/renderer/core/dom/document.cc
@@ -275,6 +275,7 @@
@@ -278,6 +278,7 @@
#include "third_party/blink/renderer/core/page/scrolling/root_scroller_controller.h"
#include "third_party/blink/renderer/core/page/scrolling/scroll_state_callback.h"
#include "third_party/blink/renderer/core/page/scrolling/scrolling_coordinator.h"
+#include "extensions/video_bg_play.h"
#include "third_party/blink/renderer/core/page/scrolling/snap_coordinator.h"
#include "third_party/blink/renderer/core/page/scrolling/text_fragment_handler.h"
#include "third_party/blink/renderer/core/page/scrolling/top_document_root_scroller_controller.h"
@@ -342,6 +343,8 @@
#include "third_party/blink/renderer/core/page/spatial_navigation_controller.h"
@@ -346,6 +347,8 @@
#include "third_party/blink/renderer/platform/wtf/text/string_buffer.h"
#include "third_party/blink/renderer/platform/wtf/text/text_encoding_registry.h"
@ -48,7 +48,7 @@ Send a random key press to circumvent idle status detection
#ifndef NDEBUG
using WeakDocumentSet = blink::HeapHashSet<blink::WeakMember<blink::Document>>;
static WeakDocumentSet& LiveDocumentSet();
@@ -6509,6 +6512,61 @@ void Document::setAllowDeclarativeShadow
@@ -6586,6 +6589,61 @@ void Document::setAllowDeclarativeShadow
val ? AllowState::kAllow : AllowState::kDeny;
}
@ -110,7 +110,7 @@ Send a random key press to circumvent idle status detection
void Document::FinishedParsing() {
DCHECK(!GetScriptableDocumentParser() || !parser_->IsParsing());
DCHECK(!GetScriptableDocumentParser() || ready_state_ != kLoading);
@@ -6567,6 +6625,10 @@ void Document::FinishedParsing() {
@@ -6644,6 +6702,10 @@ void Document::FinishedParsing() {
if (frame->IsMainFrame() && ShouldMarkFontPerformance())
FontPerformance::MarkDomContentLoaded();
@ -123,7 +123,7 @@ Send a random key press to circumvent idle status detection
probe::DomContentLoadedEventFired(frame);
--- a/third_party/blink/renderer/core/dom/document.h
+++ b/third_party/blink/renderer/core/dom/document.h
@@ -1771,6 +1771,9 @@ class CORE_EXPORT Document : public Cont
@@ -1836,6 +1836,9 @@ class CORE_EXPORT Document : public Cont
void AddAXContext(AXContext*);
void RemoveAXContext(AXContext*);

6
patches/Bromite/Remove-account-permissions-from-manifest.patch

@ -45,12 +45,12 @@ Subject: Remove all sync and account permissions/features from manifest
--- a/chrome/android/java/src/org/chromium/chrome/browser/sync/AndroidSyncSettings.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/sync/AndroidSyncSettings.java
@@ -260,7 +260,7 @@ public class AndroidSyncSettings {
@@ -251,7 +251,7 @@ public class AndroidSyncSettings {
mIsSyncable = false;
mChromeSyncEnabled = false;
}
- mMasterSyncEnabled = mSyncContentResolverDelegate.getMasterSyncAutomatically();
+ mMasterSyncEnabled = false;
if (mAccount != null && SyncService.get() != null
&& ChromeFeatureList.isEnabled(
if (mAccount != null && SyncService.get() != null && mMasterSyncEnabled
&& !mShouldDecoupleSyncFromMasterSync) {

10
patches/Bromite/Revert-flags-remove-disable-pull-to-refresh-effect.patch

@ -12,10 +12,10 @@ This reverts commit 4e598f38a0e6dd3dbede009c6a99b2a520a94e1f.
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -3464,6 +3464,10 @@ const FeatureEntry kFeatureEntries[] = {
@@ -3425,6 +3425,10 @@ const FeatureEntry kFeatureEntries[] = {
flag_descriptions::kEnableVulkanDescription,
kOsWin | kOsLinux | kOsAndroid, FEATURE_VALUE_TYPE(features::kVulkan)},
#if defined(OS_ANDROID)
#if BUILDFLAG(IS_ANDROID)
+ {switches::kDisablePullToRefreshEffect,
+ flag_descriptions::kDisablePullToRefreshEffectName,
+ flag_descriptions::kDisablePullToRefreshEffectDescription, kOsAndroid,
@ -25,7 +25,7 @@ This reverts commit 4e598f38a0e6dd3dbede009c6a99b2a520a94e1f.
flag_descriptions::kTranslateForceTriggerOnEnglishDescription, kOsAndroid,
--- a/chrome/browser/flag-metadata.json
+++ b/chrome/browser/flag-metadata.json
@@ -1179,6 +1179,11 @@
@@ -1230,6 +1230,11 @@
"expiry_milestone": -1
},
{
@ -39,7 +39,7 @@ This reverts commit 4e598f38a0e6dd3dbede009c6a99b2a520a94e1f.
"expiry_milestone": 83
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -3374,6 +3374,10 @@ const char kReadLaterDescription[] =
@@ -3333,6 +3333,10 @@ const char kReadLaterDescription[] =
"Allow users to save tabs for later. Enables a new button and menu for "
"accessing tabs saved for later.";
@ -52,7 +52,7 @@ This reverts commit 4e598f38a0e6dd3dbede009c6a99b2a520a94e1f.
"Determines what pages the Reader Mode infobar is shown on.";
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -1942,6 +1942,9 @@ extern const char kQueryTilesSegmentatio
@@ -1913,6 +1913,9 @@ extern const char kQueryTilesSegmentatio
extern const char kQueryTilesSwapTrendingName[];
extern const char kQueryTilesSwapTrendingDescription[];