Browse Source

Update to 96.0.4664.45-1

master 96.0.4664.45-1
wchen342 2 weeks ago
parent
commit
e417c7ae10
Signed by: wchen342 GPG Key ID: 9C19365D69B04CEC
  1. 4
      .build_config
  2. 8
      CHANGELOG.md
  3. 34
      README.md
  4. 4
      build.sh
  5. 283
      domain_sub_2.list
  6. 22
      patches/Bromite/AImageReader-CFI-crash-mitigations.patch
  7. 141
      patches/Bromite/Add-a-proxy-configuration-page.patch
  8. 211
      patches/Bromite/Add-an-always-incognito-mode.patch
  9. 167
      patches/Bromite/Add-bookmark-import-export-actions.patch
  10. 20
      patches/Bromite/Add-exit-menu-item.patch
  11. 28
      patches/Bromite/Add-flag-to-disable-WebGL.patch
  12. 37
      patches/Bromite/Add-option-to-not-persist-tabs-across-sessions.patch
  13. 8
      patches/Bromite/Change-default-webRTC-policy-to-not-use-any-address.patch
  14. 2
      patches/Bromite/Disable-DRM-media-origin-IDs-preprovisioning.patch
  15. 4
      patches/Bromite/DoH-secure-mode-by-default.patch
  16. 16
      patches/Bromite/Inject-scripts-for-AMP-tracking-ads-and-video.patch
  17. 22
      patches/Bromite/Revert-flags-remove-disable-pull-to-refresh-effect.patch
  18. 4
      patches/Bromite/updater-disable-updater-pings.patch
  19. 24
      patches/Other/debug-fix.patch
  20. 4
      patches/Unobtainium/kill-GCM.patch
  21. 12
      patches/Unobtainium/kill-Translate.patch
  22. 24
      patches/Vanadium/0002-use-64-bit-WebView-processes.patch
  23. 2
      patches/Vanadium/0003-switch-to-fstack-protector-strong.patch
  24. 27
      patches/Vanadium/0004-enable-fwrapv-in-Clang-for-non-UBSan-builds.patch
  25. 21
      patches/Vanadium/0016-disable-seed-based-field-trials.patch
  26. 41
      patches/Vanadium/0018-disable-WebView-variations-support.patch
  27. 15
      patches/Vanadium/0022-disable-metrics-by-default.patch
  28. 0
      patches/Vanadium/0024-disable-showing-popular-sites-by-default.patch
  29. 13
      patches/Vanadium/0033-disable-media-router-media-remoting-by-default.patch
  30. 6
      patches/Vanadium/0034-disable-media-router-by-default.patch
  31. 25
      patches/Vanadium/0042-enable-user-agent-freeze-by-default.patch
  32. 25
      patches/Vanadium/0043-enable-split-cache-by-default.patch
  33. 50
      patches/Vanadium/0044-enable-partitioning-connections-by-default.patch
  34. 46
      patches/Vanadium/0050-enable-strict-site-isolation-by-default-on-Android.patch
  35. 25
      patches/Vanadium/0054-always-use-local-new-tab-page.patch
  36. 7
      patches/Vanadium/0076-disable-using-Play-services-fonts.patch
  37. 22
      patches/series
  38. 16
      patches/src-fix/clang-unknown-warnings.patch
  39. 19
      patches/src-fix/fix-gtest-visibility.patch
  40. 2
      patches/src-fix/fix-prefs.patch
  41. 19
      patches/src-fix/fix-py3.10-collections.patch
  42. 115
      patches/src-fix/fix-safe-browsing.patch
  43. 20
      patches/ungoogled-chromium-android/Add-always-desktop-option.patch
  44. 14
      patches/ungoogled-chromium-android/Add-folder-button-bookmark.patch
  45. 35
      patches/ungoogled-chromium-android/Add-force-tablet-ui-option.patch
  46. 8
      patches/ungoogled-chromium-android/Add-save-data-flag.patch
  47. 8
      patches/ungoogled-chromium-android/Add_trichrome_apk.patch
  48. 4
      patches/ungoogled-chromium-android/Change-package-name-chromium.patch
  49. 2
      patches/ungoogled-chromium-android/Disable-contextual-search.patch
  50. 2
      patches/ungoogled-chromium-android/Disable-homepage-by-default.patch
  51. 17
      patches/ungoogled-chromium-android/Disable-offline-indicator.patch
  52. 2
      patches/ungoogled-chromium-android/Enable-ProactivelySwapBrowsingInstance.patch
  53. 24
      patches/ungoogled-chromium-android/Enable-update-notification.patch
  54. 79
      patches/ungoogled-chromium-android/Remove-UI-elements.patch
  55. 4
      patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.auth.patch
  56. 8
      patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.cast.patch
  57. 14
      patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.common-auth-signin-dynamic-com.google.android.gms.tasks.patch
  58. 28
      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. 10
      patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.gcm.patch
  61. 102
      patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.gms.vision-com.google.android.gms.clearcut-com.google.android.gms.phenotype.patch
  62. 4
      patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.play.core.splitcompat-com.google.android.play.core.splitinstall.patch
  63. 4
      patches/ungoogled-chromium-android/Remove-dependency-on-com.google.android.play.patch
  64. 8
      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=95.0.4638.74
ungoogled_chromium_version=95.0.4638.69
chromium_version=96.0.4664.45
ungoogled_chromium_version=96.0.4664.45
ungoogled_chromium_revision=1
ungoogled_chromium_android_revision=1

8
CHANGELOG.md

@ -1,3 +1,11 @@
# 96.0.4664.45-1
* Re-enable bookmark import-export
* Disable offline indicator
* Add extra Vanadium enhancements:
* Enable user-agent freeze
* Enable split cache, partitioning connections, strict site isolation
* Other compiling time enhancements
# 95.0.4638.74-1
* Upstream update

34
README.md

@ -37,12 +37,13 @@ In descending order of significance (i.e. most important objective first):
*These are the differences between a Linux build of ungoogled-chromium and ungoogled-chromium-android.*
* Disable Android specific functionalities:
* lite mode
* contextual search
* prefetch
* remove home page links
* remove unnecessary account permissions
* Disable/Remove Android specific functionalities:
* Contextual search
* Lite mode
* Offline indicator
* Prefetch
* Home page links
* Unnecessary account permissions
* Android specific enhancements:
* Add `Startpage.com` and `Qwant.com` as search engine options
* Add new folder button in bookmark manager
@ -51,13 +52,22 @@ In descending order of significance (i.e. most important objective first):
* Add flags to always send `save-data` flag in header
* Add flags to force tablet UI and desktop mode
* Borrowed from Bromite:
* Exit menu item
* flag to disable device orientation API
* option to clear open tabs between sessions
* prevent WebRTC address leaking
* enable DNS-over-Https by default
* Add bookmark import/export options
* Always incognito mode
* Bookmark import/export options
* Clear open tabs between sessions
* Disable DRM media preprovisioning which leaks connections
* DNS-over-https by default
* Exit menu item
* Prevent WebRTC address leaking
* Proxy configuration
* WebGL flag
* Borrowed from Vanadium:
* Disable seed-based field trials
* Disable media router
* Disable metrics
* Enable user-agent freeze
* Enable split cache, partitioning connections, strict site isolation
* Various compiling time enhancements
* All Google play and Google service related blobs are removed. This includes Firebase, GCM (Google Cloud Messaging), GMS (Google Mobile Services) and bridge to Google Play.
* Releases are built for `arm`, `arm64` and `x86`. There is no `x86_64` build.

4
build.sh

@ -243,7 +243,7 @@ popd
# Some of the support libraries can be grabbed from maven https://android.googlesource.com/platform/prebuilts/maven_repo/android/+/master/com/android/support/
## Prepare Android SDK/NDK
SDK_NAME="android-sdk_eng.12.0.0_r2_linux-x86"
SDK_NAME="android-sdk_user-12.0.0_r13_linux-x86"
SDK_VERSION_CODE="12"
# Create symbol links to sdk folders
@ -276,7 +276,7 @@ popd
mkdir android-sdk
mkdir android-ndk
pushd android-rebuilds
unzip -qqo ${SDK_NAME}.zip -d ../android-sdk && mv ../android-sdk/android-sdk_eng.build_linux-x86 ../android-sdk/${SDK_NAME} && rm -f ${SDK_NAME}.zip && s=0 || s=$? && (exit $s)
unzip -qqo ${SDK_NAME}.zip -d ../android-sdk && rm -f ${SDK_NAME}.zip && s=0 || s=$? && (exit $s)
unzip -qqo sdk-repo-linux-tools-26.1.1.zip -d ../android-sdk/${SDK_NAME} && rm -f sdk-repo-linux-tools-26.1.1.zip && s=0 || s=$? && (exit $s)
unzip -qqo android-ndk-r23-linux-x86_64.zip -d ../android-ndk && rm -f android-ndk-r23-linux-x86_64.zip && s=0 || s=$? && (exit $s)
popd

283
domain_sub_2.list

File diff suppressed because it is too large

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

@ -59,9 +59,9 @@ See discussions at:
AndroidImageReader::AndroidImageReader() : is_supported_(LoadFunctions()) {}
--- 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();
@@ -25,6 +25,9 @@ class BASE_EXPORT AndroidImageReader {
AndroidImageReader(const AndroidImageReader&) = delete;
AndroidImageReader& operator=(const AndroidImageReader&) = delete;
+ // Disable image reader support.
+ static void DisableSupport();
@ -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.
@@ -59,6 +62,7 @@ class BASE_EXPORT AndroidImageReader {
@@ -62,6 +65,7 @@ class BASE_EXPORT AndroidImageReader {
jobject ANativeWindow_toSurface(JNIEnv* env, ANativeWindow* window);
private:
@ -79,11 +79,11 @@ See discussions at:
AndroidImageReader();
--- a/chrome/browser/flag-metadata.json
+++ b/chrome/browser/flag-metadata.json
@@ -2101,7 +2101,7 @@
@@ -2064,7 +2064,7 @@
{
"name": "enable-image-reader",
"owners": [ "vikassoni", "liberato" ],
- "expiry_milestone": 95
- "expiry_milestone": 115
+ "expiry_milestone": -1
},
{
@ -163,7 +163,7 @@ 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
@@ -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
@ -173,7 +173,7 @@ See discussions at:
disable_accelerated_vp8_decode
--- a/gpu/ipc/service/gpu_init.cc
+++ b/gpu/ipc/service/gpu_init.cc
@@ -517,6 +517,11 @@ bool GpuInit::InitializeAndStartSandbox(
@@ -521,6 +521,11 @@ bool GpuInit::InitializeAndStartSandbox(
}
}
@ -195,7 +195,7 @@ See discussions at:
#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> M
@@ -51,7 +52,15 @@ std::unique_ptr<ui::ScopedMakeCurrent> M
}
TextureOwner::Mode GetTextureOwnerMode() {
@ -214,7 +214,7 @@ See discussions at:
}
--- a/media/base/media_switches.cc
+++ b/media/base/media_switches.cc
@@ -657,6 +657,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 +227,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
@@ -219,6 +219,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;

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

@ -23,7 +23,7 @@ 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 | 416 ++++++++++
chrome/browser/ui/webui/proxy_config_ui.cc | 419 ++++++++++
chrome/browser/ui/webui/proxy_config_ui.h | 33
chrome/common/webui_url_constants.cc | 4
chrome/common/webui_url_constants.h | 2
@ -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, 995 insertions(+), 14 deletions(-)
24 files changed, 998 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
@@ -55,6 +55,7 @@ public class PrivacySettings
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_CLOSE_TABS_ON_EXIT = "close_tabs_on_exit";
+ private static final String PREF_PROXY_OPTIONS = "proxy";
@@ -60,6 +60,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";
+ private static final String PREF_PROXY_OPTIONS = "proxy";
private static final String PREF_CLOSE_TABS_ON_EXIT = "close_tabs_on_exit";
--- a/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc
+++ b/chrome/browser/autocomplete/chrome_autocomplete_provider_client.cc
@@ -366,6 +366,8 @@ ChromeAutocompleteProviderClient::GetBui
@@ -373,6 +373,8 @@ ChromeAutocompleteProviderClient::GetBui
base::ASCIIToUTF16(chrome::kChromeUISettingsURL));
#endif
builtins_to_provide.push_back(
@ -113,7 +113,7 @@ for SimpleURLLoaders as well.
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chromeos/network/proxy/proxy_config_service_impl.h"
@@ -59,7 +62,20 @@ ProxyServiceFactory::CreatePrefProxyConf
@@ -73,7 +76,20 @@ ProxyServiceFactory::CreatePrefProxyConf
return std::make_unique<chromeos::ProxyConfigServiceImpl>(
profile_prefs, local_state_prefs, nullptr);
#else
@ -135,7 +135,7 @@ for SimpleURLLoaders as well.
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
}
@@ -75,3 +91,8 @@ ProxyServiceFactory::CreatePrefProxyConf
@@ -89,3 +105,8 @@ ProxyServiceFactory::CreatePrefProxyConf
nullptr);
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
}
@ -154,18 +154,18 @@ for SimpleURLLoaders as well.
class PrefProxyConfigTracker;
class PrefService;
@@ -37,6 +38,8 @@ class ProxyServiceFactory {
@@ -42,6 +43,8 @@ class ProxyServiceFactory {
// (ChromeOS only).
static std::unique_ptr<PrefProxyConfigTracker>
CreatePrefProxyConfigTrackerOfLocalState(PrefService* local_state_prefs);
+ static void RegisterPrefs(PrefRegistrySimple* registry);
+
private:
DISALLOW_IMPLICIT_CONSTRUCTORS(ProxyServiceFactory);
+ static void RegisterPrefs(PrefRegistrySimple* registry);
};
#endif // CHROME_BROWSER_NET_PROXY_SERVICE_FACTORY_H_
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -159,6 +159,8 @@
@@ -163,6 +163,8 @@
#include "printing/buildflags/buildflags.h"
#include "rlz/buildflags/buildflags.h"
@ -174,7 +174,7 @@ for SimpleURLLoaders as well.
#if BUILDFLAG(ENABLE_BACKGROUND_MODE)
#include "chrome/browser/background/background_mode_manager.h"
#endif
@@ -939,6 +941,8 @@ void RegisterLocalState(PrefRegistrySimp
@@ -957,6 +959,8 @@ void RegisterLocalState(PrefRegistrySimp
PluginsResourceService::RegisterPrefs(registry);
#endif
@ -185,7 +185,7 @@ for SimpleURLLoaders as well.
--- a/chrome/browser/prefs/chrome_command_line_pref_store.cc
+++ b/chrome/browser/prefs/chrome_command_line_pref_store.cc
@@ -154,7 +154,7 @@ void ChromeCommandLinePrefStore::ApplyPr
@@ -158,7 +158,7 @@ void ChromeCommandLinePrefStore::ApplyPr
SetValue(
proxy_config::prefs::kProxy,
std::make_unique<base::Value>(ProxyConfigDictionary::CreateFixedServers(
@ -611,7 +611,7 @@ for SimpleURLLoaders as well.
+})();
--- a/chrome/browser/ui/BUILD.gn
+++ b/chrome/browser/ui/BUILD.gn
@@ -267,6 +267,8 @@ static_library("ui") {
@@ -280,6 +280,8 @@ static_library("ui") {
"webui/metrics_handler.h",
"webui/net_export_ui.cc",
"webui/net_export_ui.h",
@ -629,8 +629,8 @@ for SimpleURLLoaders as well.
+#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/signin_internals_ui.h"
#include "chrome/browser/ui/webui/sync_internals/sync_internals_ui.h"
@@ -641,6 +642,8 @@ WebUIFactoryFunction GetWebUIFactoryFunc
#include "chrome/browser/ui/webui/support_tool_ui.h"
@@ -647,6 +648,8 @@ WebUIFactoryFunction GetWebUIFactoryFunc
return &NewWebUI<MemoryInternalsUI>;
if (url.host_piece() == chrome::kChromeUINetExportHost)
return &NewWebUI<NetExportUI>;
@ -641,7 +641,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,416 @@
@@ -0,0 +1,419 @@
+/*
+ This file is part of Bromite.
+
@ -728,9 +728,9 @@ for SimpleURLLoaders as well.
+ void RegisterMessages() override;
+
+ // Messages
+ void OnEnableNotifyUIWithState(const base::ListValue* list);
+ void OnApply(const base::ListValue* config);
+ void OnClear(const base::ListValue* config);
+ void OnEnableNotifyUIWithState(base::Value::ConstListView list);
+ void OnApply(base::Value::ConstListView config);
+ void OnClear(base::Value::ConstListView config);
+
+ // net::ProxyConfigService::Observer implementation:
+ // Calls ProxyConfigView.onProxyConfigChanged JavaScript function in the
@ -782,7 +782,7 @@ for SimpleURLLoaders as well.
+ }
+
+ proxy_config_service_ = ProxyServiceFactory::CreateProxyConfigService(
+ pref_proxy_config_tracker_.get());
+ pref_proxy_config_tracker_.get(), profile);
+}
+
+void ProxyConfigMessageHandler::OnProxyConfigChanged(
@ -874,15 +874,15 @@ for SimpleURLLoaders as well.
+void ProxyConfigMessageHandler::RegisterMessages() {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+
+ web_ui()->RegisterDeprecatedMessageCallback(
+ web_ui()->RegisterMessageCallback(
+ "enableNotifyUIWithState",
+ base::BindRepeating(&ProxyConfigMessageHandler::OnEnableNotifyUIWithState,
+ base::Unretained(this)));
+ web_ui()->RegisterDeprecatedMessageCallback(
+ web_ui()->RegisterMessageCallback(
+ "apply",
+ base::BindRepeating(&ProxyConfigMessageHandler::OnApply,
+ base::Unretained(this)));
+ web_ui()->RegisterDeprecatedMessageCallback(
+ web_ui()->RegisterMessageCallback(
+ "clear",
+ base::BindRepeating(&ProxyConfigMessageHandler::OnClear,
+ base::Unretained(this)));
@ -891,7 +891,7 @@ for SimpleURLLoaders as well.
+// The proxy configuration UI is not notified of state changes until this function runs.
+// After this function, OnProxyConfigChanged() will be called on all proxy state changes.
+void ProxyConfigMessageHandler::OnEnableNotifyUIWithState(
+ const base::ListValue* list) {
+ base::Value::ConstListView list) {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+
+ if (!is_observing_) {
@ -913,24 +913,24 @@ for SimpleURLLoaders as well.
+ OnProxyConfigChanged(config, availability);
+}
+
+void ProxyConfigMessageHandler::OnClear(const base::ListValue* list) {
+void ProxyConfigMessageHandler::OnClear(base::Value::ConstListView list) {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+
+ const base::Value cfg = ProxyConfigDictionary::CreateSystem();
+ pref_service_->Set(proxy_config::prefs::kProxy, cfg);
+ pref_service_->CommitPendingWrite();
+ OnEnableNotifyUIWithState(nullptr);
+ OnEnableNotifyUIWithState(list);
+}
+
+void ProxyConfigMessageHandler::OnApply(const base::ListValue* list) {
+void ProxyConfigMessageHandler::OnApply(base::Value::ConstListView list) {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+
+ if ((list->GetList().size() != 1) || !list->GetList()[0].is_dict()) {
+ if ((list.size() != 1) || !list[0].is_dict()) {
+ return;
+ }
+
+ const base::DictionaryValue* config = nullptr;
+ if (!list->GetDictionary(0, &config))
+ if (!list[0].GetAsDictionary(&config))
+ return;
+
+ const base::Value *autoDetect = config->FindKeyOfType("auto_detect", base::Value::Type::BOOLEAN);
@ -1000,7 +1000,8 @@ for SimpleURLLoaders as well.
+ } else if (t == "direct") {
+ proxyConfig.proxy_rules().type = net::ProxyConfig::ProxyRules::Type::EMPTY;
+ } else if (t == "none") {
+ OnClear(nullptr);
+ base::Value::ConstListView empty;
+ OnClear(empty);
+ return;
+ } else {
+ // invalid type
@ -1045,7 +1046,9 @@ for SimpleURLLoaders as well.
+ pref_service_->Set(proxy_config::prefs::kProxy, cfg);
+ }
+ pref_service_->CommitPendingWrite();
+ OnEnableNotifyUIWithState(nullptr);
+
+ base::Value::ConstListView empty;
+ OnEnableNotifyUIWithState(empty);
+}
+
+} // namespace
@ -1096,7 +1099,7 @@ for SimpleURLLoaders as well.
+#endif // CHROME_BROWSER_UI_WEBUI_PROXY_CONFIG_UI_H_
--- a/chrome/common/webui_url_constants.cc
+++ b/chrome/common/webui_url_constants.cc
@@ -35,6 +35,8 @@ const char kChromeUICertificateViewerHos
@@ -37,6 +37,8 @@ const char kChromeUICertificateViewerHos
const char kChromeUICertificateViewerURL[] = "chrome://view-cert/";
const char kChromeUIChromeSigninHost[] = "chrome-signin";
const char kChromeUIChromeSigninURL[] = "chrome://chrome-signin/";
@ -1105,7 +1108,7 @@ for SimpleURLLoaders as well.
const char kChromeUIChromeURLsHost[] = "chrome-urls";
const char kChromeUIChromeURLsURL[] = "chrome://chrome-urls/";
const char kChromeUIComponentsHost[] = "components";
@@ -346,6 +348,7 @@ bool IsSystemWebUIHost(base::StringPiece
@@ -354,6 +356,7 @@ bool IsSystemWebUIHost(base::StringPiece
kChromeUIMobileSetupHost,
kChromeUIMultiDeviceSetupHost,
kChromeUINetworkHost,
@ -1113,7 +1116,7 @@ for SimpleURLLoaders as well.
kChromeUIOobeHost,
kChromeUIOSCreditsHost,
kChromeUIOSSettingsHost,
@@ -568,6 +571,7 @@ const char* const kChromeHostURLs[] = {
@@ -584,6 +587,7 @@ const char* const kChromeHostURLs[] = {
#if !defined(OS_ANDROID)
#if !BUILDFLAG(IS_CHROMEOS_ASH)
kChromeUIAppLauncherPageHost,
@ -1123,7 +1126,7 @@ for SimpleURLLoaders as well.
kChromeUIDownloadsHost,
--- a/chrome/common/webui_url_constants.h
+++ b/chrome/common/webui_url_constants.h
@@ -126,6 +126,8 @@ extern const char kChromeUIMemoryInterna
@@ -127,6 +127,8 @@ extern const char kChromeUIMemoryInterna
extern const char kChromeUINTPTilesInternalsHost[];
extern const char kChromeUINaClHost[];
extern const char kChromeUINetExportHost[];
@ -1132,17 +1135,6 @@ for SimpleURLLoaders as well.
extern const char kChromeUINetInternalsHost[];
extern const char kChromeUINetInternalsURL[];
extern const char kChromeUINewTabHost[];
--- a/components/proxy_config/proxy_policy_handler.cc
+++ b/components/proxy_config/proxy_policy_handler.cc
@@ -259,7 +259,7 @@ void ProxyPolicyHandler::ApplyPolicySett
ProxyConfigDictionary::CreateFixedServers(
server->GetString(), bypass_list && bypass_list->is_string()
? bypass_list->GetString()
- : std::string()));
+ : std::string(), false));
}
break;
}
--- a/components/proxy_config/pref_proxy_config_tracker_impl.cc
+++ b/components/proxy_config/pref_proxy_config_tracker_impl.cc
@@ -380,6 +380,7 @@ bool PrefProxyConfigTrackerImpl::PrefCon
@ -1155,7 +1147,7 @@ for SimpleURLLoaders as well.
return true;
--- a/components/proxy_config/proxy_config_dictionary.cc
+++ b/components/proxy_config/proxy_config_dictionary.cc
@@ -28,6 +28,8 @@ const char kProxyPacMandatory[] = "pac_m
@@ -30,6 +30,8 @@ const char kProxyPacMandatory[] = "pac_m
// String containing proxy bypass rules. For a specification of the
// expected syntax see net::ProxyBypassRules::ParseFromString().
const char kProxyBypassList[] = "bypass_list";
@ -1164,7 +1156,7 @@ for SimpleURLLoaders as well.
} // namespace
@@ -72,6 +74,14 @@ bool ProxyConfigDictionary::HasBypassLis
@@ -78,6 +80,14 @@ bool ProxyConfigDictionary::HasBypassLis
return dict_.FindKey(kProxyBypassList);
}
@ -1179,7 +1171,7 @@ for SimpleURLLoaders as well.
const base::Value& ProxyConfigDictionary::GetDictionary() const {
return dict_;
}
@@ -79,29 +89,30 @@ const base::Value& ProxyConfigDictionary
@@ -85,29 +95,30 @@ const base::Value& ProxyConfigDictionary
// static
base::Value ProxyConfigDictionary::CreateDirect() {
return CreateDictionary(ProxyPrefs::MODE_DIRECT, std::string(), false,
@ -1215,7 +1207,7 @@ for SimpleURLLoaders as well.
} else {
return CreateDirect();
}
@@ -110,7 +121,7 @@ base::Value ProxyConfigDictionary::Creat
@@ -116,7 +127,7 @@ base::Value ProxyConfigDictionary::Creat
// static
base::Value ProxyConfigDictionary::CreateSystem() {
return CreateDictionary(ProxyPrefs::MODE_SYSTEM, std::string(), false,
@ -1224,7 +1216,7 @@ for SimpleURLLoaders as well.
}
// static
@@ -119,7 +130,8 @@ base::Value ProxyConfigDictionary::Creat
@@ -125,7 +136,8 @@ base::Value ProxyConfigDictionary::Creat
const std::string& pac_url,
bool pac_mandatory,
const std::string& proxy_server,
@ -1234,7 +1226,7 @@ for SimpleURLLoaders as well.
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::Creat
@@ -134,8 +146,10 @@ base::Value ProxyConfigDictionary::Creat
}
if (!proxy_server.empty())
dict.SetKey(kProxyServer, base::Value(proxy_server));
@ -1248,7 +1240,7 @@ for SimpleURLLoaders as well.
--- a/components/proxy_config/proxy_config_dictionary.h
+++ b/components/proxy_config/proxy_config_dictionary.h
@@ -38,6 +38,7 @@ class PROXY_CONFIG_EXPORT ProxyConfigDic
@@ -43,6 +43,7 @@ class PROXY_CONFIG_EXPORT ProxyConfigDic
bool GetProxyServer(std::string* out) const;
bool GetBypassList(std::string* out) const;
bool HasBypassList() const;
@ -1256,7 +1248,7 @@ for SimpleURLLoaders as well.
const base::Value& GetDictionary() const;
@@ -46,7 +47,8 @@ class PROXY_CONFIG_EXPORT ProxyConfigDic
@@ -51,7 +52,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,
@ -1266,7 +1258,7 @@ for SimpleURLLoaders as well.
static base::Value CreateSystem();
// Encodes the proxy server as "<url-scheme>=<proxy-scheme>://<proxy>".
@@ -62,7 +64,8 @@ class PROXY_CONFIG_EXPORT ProxyConfigDic
@@ -67,7 +69,8 @@ class PROXY_CONFIG_EXPORT ProxyConfigDic
const std::string& pac_url,
bool pac_mandatory,
const std::string& proxy_server,
@ -1275,10 +1267,21 @@ for SimpleURLLoaders as well.
+ bool reverse_bypass);
base::Value dict_;
};
--- a/components/proxy_config/proxy_policy_handler.cc
+++ b/components/proxy_config/proxy_policy_handler.cc
@@ -259,7 +259,7 @@ void ProxyPolicyHandler::ApplyPolicySett
ProxyConfigDictionary::CreateFixedServers(
server->GetString(), bypass_list && bypass_list->is_string()
? bypass_list->GetString()
- : std::string()));
+ : std::string(), false));
}
break;
}
--- a/net/proxy_resolution/proxy_config.cc
+++ b/net/proxy_resolution/proxy_config.cc
@@ -110,7 +110,7 @@ void ProxyConfig::ProxyRules::ParseFromS
@@ -112,7 +112,7 @@ void ProxyConfig::ProxyRules::ParseFromS
&single_proxies,
ProxyServer::SCHEME_HTTP);
type = Type::PROXY_LIST;
@ -1287,7 +1290,7 @@ for SimpleURLLoaders as well.
}
// Trim whitespace off the url scheme.
@@ -141,6 +141,56 @@ void ProxyConfig::ProxyRules::ParseFromS
@@ -143,6 +143,56 @@ void ProxyConfig::ProxyRules::ParseFromS
}
}
@ -1301,7 +1304,7 @@ for SimpleURLLoaders as well.
+ std::string proxy_list;
+ for (const ProxyServer& proxy_server :
+ single_proxies.GetAll()) {
+ proxy_list += proxy_server.ToURI() + ";";
+ proxy_list += proxy_server.host_port_pair().ToString() + ";";
+ }
+ // remove last semicolon
+ if (proxy_list.length() != 0 ) {
@ -1320,19 +1323,19 @@ for SimpleURLLoaders as well.
+ std::string list;
+ for (const ProxyServer& proxy_server :
+ proxies_for_http.GetAll()) {
+ list += "http=" + proxy_server.ToURI() + ";";
+ list += "http=" + proxy_server.host_port_pair().ToString() + ";";
+ }
+ for (const ProxyServer& proxy_server :
+ proxies_for_https.GetAll()) {
+ list += "https=" + proxy_server.ToURI() + ";";
+ list += "https=" + proxy_server.host_port_pair().ToString() + ";";
+ }
+ for (const ProxyServer& proxy_server :
+ proxies_for_ftp.GetAll()) {
+ list += "ftp=" + proxy_server.ToURI() + ";";
+ list += "ftp=" + proxy_server.host_port_pair().ToString() + ";";
+ }
+ for (const ProxyServer& proxy_server :
+ fallback_proxies.GetAll()) {
+ list += "socks=" + proxy_server.ToURI() + ";";
+ list += "socks=" + proxy_server.host_port_pair().ToString() + ";";
+ }
+ if (list.length() != 0 ) {
+ // remove last semicolon

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

@ -7,23 +7,28 @@ clicked links to launch as incognito.
Make sure initial incognito status is correctly recognized.
Enable incognito custom tabs and fix crashes for incognito/custom tab intents (credits to @uazo)
---
chrome/android/chrome_java_sources.gni | 1
chrome/android/java/src/org/chromium/chrome/browser/AlwaysIncognitoLinkInterceptor.java | 80 ++++++++++
chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java | 6
chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java | 4
chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateImpl.java | 6
chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java | 8 -
chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivityLifecycleUmaTracker.java | 25 ---
chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java | 5
chrome/android/java/src/org/chromium/chrome/browser/init/StartupTabPreloader.java | 14 +
chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java | 1
chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreator.java | 16 +-
chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPersistentStore.java | 10 +
chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappIntentDataProvider.java | 14 +
chrome/browser/flags/android/chrome_feature_list.cc | 2
chrome/browser/ui/android/strings/android_chrome_strings.grd | 7
15 files changed, 165 insertions(+), 34 deletions(-)
chrome/android/chrome_java_sources.gni | 1
chrome/android/java/res/xml/privacy_preferences.xml | 5
chrome/android/java/src/org/chromium/chrome/browser/AlwaysIncognitoLinkInterceptor.java | 80 ++++++++++
chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java | 6
chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java | 4
chrome/android/java/src/org/chromium/chrome/browser/app/appmenu/AppMenuPropertiesDelegateImpl.java | 6
chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java | 8 -
chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabActivityLifecycleUmaTracker.java | 25 ---
chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIntentDataProvider.java | 5
chrome/android/java/src/org/chromium/chrome/browser/init/StartupTabPreloader.java | 14 +
chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java | 37 ++++
chrome/android/java/src/org/chromium/chrome/browser/settings/SettingsActivity.java | 4
chrome/android/java/src/org/chromium/chrome/browser/tabmodel/ChromeTabCreator.java | 16 +-
chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabPersistentStore.java | 10 +
chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappIntentDataProvider.java | 14 +
chrome/browser/flags/android/chrome_feature_list.cc | 2
chrome/browser/ui/android/strings/android_chrome_strings.grd | 13 +
chrome/browser/ui/messages/android/BUILD.gn | 1
chrome/browser/ui/messages/android/java/src/org/chromium/chrome/browser/ui/messages/snackbar/INeedSnackbarManager.java | 27 +++
19 files changed, 243 insertions(+), 35 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
--- a/chrome/android/chrome_java_sources.gni
+++ b/chrome/android/chrome_java_sources.gni
@ -35,6 +40,20 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c
"java/src/com/google/android/apps/chrome/appwidget/bookmarks/BookmarkThumbnailWidgetProvider.java",
"java/src/org/chromium/chrome/browser/ActivityTabProvider.java",
"java/src/org/chromium/chrome/browser/ActivityUtils.java",
--- a/chrome/android/java/res/xml/privacy_preferences.xml
+++ b/chrome/android/java/res/xml/privacy_preferences.xml
@@ -50,6 +50,11 @@
android:title="@string/close_tabs_on_exit_title"
android:summary="@string/close_tabs_on_exit_summary"
android:defaultValue="false" />
+ <org.chromium.components.browser_ui.settings.ChromeSwitchPreference
+ android:key="always_incognito"
+ android:title="@string/always_incognito_title"
+ android:summary="@string/always_incognito_summary"
+ android:defaultValue="false" />
<Preference
android:fragment="org.chromium.chrome.browser.privacy.settings.DoNotTrackSettings"
android:key="do_not_track"
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/AlwaysIncognitoLinkInterceptor.java
@@ -0,0 +1,80 @@
@ -128,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;
@@ -1773,8 +1774,9 @@ public class ChromeTabbedActivity extend
@@ -1779,8 +1780,9 @@ public class ChromeTabbedActivity extend
Bundle savedInstanceState = getSavedInstanceState();
// We determine the model as soon as possible so every systems get initialized coherently.
@ -150,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;
@@ -1959,6 +1960,9 @@ public abstract class ChromeActivity<C e
@@ -1966,6 +1967,9 @@ public abstract class ChromeActivity<C e
throw new IllegalStateException(
"Attempting to access TabCreator before initialization");
}
@ -162,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
@@ -378,6 +378,12 @@ public class AppMenuPropertiesDelegateIm
@@ -538,6 +538,12 @@ public class AppMenuPropertiesDelegateIm
}
private void prepareCommonMenuItems(Menu menu, @MenuGroup int menuGroup, boolean isIncognito) {
@ -174,7 +193,7 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c
+
// 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;
--- a/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/contextmenu/ChromeContextMenuPopulator.java
@@ -31,6 +31,7 @@ import org.chromium.base.ContextUtils;
@ -308,14 +327,96 @@ 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
@@ -47,6 +47,7 @@ import org.chromium.ui.text.SpanApplier;
@@ -32,6 +32,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;
+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.sync.settings.GoogleServicesSettings;
import org.chromium.chrome.browser.sync.settings.ManageSyncSettings;
import org.chromium.chrome.browser.usage_stats.UsageStatsConsentDialog;
@@ -49,7 +53,12 @@ import org.chromium.ui.text.SpanApplier;
* Fragment to keep track of the all the privacy related preferences.
*/
public class PrivacySettings
extends PreferenceFragmentCompat implements Preference.OnPreferenceChangeListener {
- extends PreferenceFragmentCompat implements Preference.OnPreferenceChangeListener {
+ extends PreferenceFragmentCompat implements Preference.OnPreferenceChangeListener,
+ INeedSnackbarManager {
+ private SnackbarManager mSnackbarManager;
+ private Snackbar mSnackbar;
+
+ 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_HTTPS_FIRST_MODE = "https_first_mode";
@@ -94,6 +103,25 @@ public class PrivacySettings
(ChromeSwitchPreference) findPreference(PREF_CAN_MAKE_PAYMENT);
canMakePaymentPref.setOnPreferenceChangeListener(this);
+ ChromeSwitchPreference alwaysIncognitoPref =
+ (ChromeSwitchPreference) findPreference(PREF_ALWAYS_INCOGNITO);
+ alwaysIncognitoPref.setOnPreferenceChangeListener(this);
+
+ mSnackbar = Snackbar.make(getActivity().getString(R.string.ui_relaunch_notice),
+ new SnackbarManager.SnackbarController() {
+ @Override
+ public void onDismissNoAction(Object actionData) { }
+
+ @Override
+ public void onAction(Object actionData) {
+ ApplicationLifetime.terminate(true);
+ }
+ }, Snackbar.TYPE_NOTIFICATION, Snackbar.UMA_UNKNOWN)
+ .setSingleLine(false)
+ .setAction(getActivity().getString(R.string.relaunch),
+ /*actionData*/null)
+ .setDuration(/*durationMs*/70000);
+
ChromeSwitchPreference networkPredictionPref =
(ChromeSwitchPreference) findPreference(PREF_NETWORK_PREDICTIONS);
networkPredictionPref.setChecked(
@@ -182,6 +210,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);
} else if (PREF_HTTPS_FIRST_MODE.equals(key)) {
UserPrefs.get(Profile.getLastUsedRegularProfile())
.setBoolean(Pref.HTTPS_ONLY_MODE_ENABLED, (boolean) newValue);
@@ -285,4 +316,8 @@ public class PrivacySettings
}
return false;
}
+
+ public void setSnackbarManager(SnackbarManager manager) {
+ mSnackbarManager = manager;
+ }
}
--- 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
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
.getSiteSettingsDelegate());
delegate.setSnackbarManager(mSnackbarManager);
}
+ if (fragment instanceof INeedSnackbarManager) {
+ ((INeedSnackbarManager)fragment).setSnackbarManager(mSnackbarManager);
+ }
}
@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;
@ -393,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;
@@ -56,6 +57,8 @@ import org.chromium.content_public.brows
@@ -55,6 +56,8 @@ import org.chromium.content_public.brows
import org.chromium.content_public.browser.UiThreadTaskTraits;
import org.chromium.url.GURL;
@ -402,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;
@@ -654,6 +657,13 @@ public class TabPersistentStore {
@@ -643,6 +646,13 @@ public class TabPersistentStore {
}
}
}
@ -418,9 +519,9 @@ 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
@@ -28,6 +28,9 @@ import org.chromium.chrome.browser.brows
import org.chromium.chrome.browser.flags.ActivityType;
@@ -29,6 +29,9 @@ import org.chromium.chrome.browser.flags
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;
@ -428,7 +529,7 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c
/**
* Stores info about a web app.
*/
@@ -41,6 +44,8 @@ public class WebappIntentDataProvider ex
@@ -42,6 +45,8 @@ public class WebappIntentDataProvider ex
private final Intent mIntent;
private final ColorProviderImpl mColorProvider;
@ -437,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.
*/
@@ -62,6 +67,10 @@ public class WebappIntentDataProvider ex
@@ -63,6 +68,10 @@ public class WebappIntentDataProvider ex
mWebappExtras = webappExtras;
mWebApkExtras = webApkExtras;
mActivityType = (webApkExtras != null) ? ActivityType.WEB_APK : ActivityType.WEBAPP;
@ -448,7 +549,7 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c
}
@Override
@@ -151,6 +160,11 @@ public class WebappIntentDataProvider ex
@@ -152,6 +161,11 @@ public class WebappIntentDataProvider ex
}
@Override
@ -457,12 +558,12 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c
+ }
+
+ @Override
public int getDefaultOrientation() {
public @ScreenOrientationLockType.EnumType int getDefaultOrientation() {
return mWebappExtras.orientation;
}
--- a/chrome/browser/flags/android/chrome_feature_list.cc
+++ b/chrome/browser/flags/android/chrome_feature_list.cc
@@ -444,7 +444,7 @@ const base::Feature kCCTIncognito{"CCTIn
@@ -455,7 +455,7 @@ const base::Feature kCCTIncognito{"CCTIn
base::FEATURE_ENABLED_BY_DEFAULT};
const base::Feature kCCTIncognitoAvailableToThirdParty{
@ -473,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
@@ -928,6 +928,13 @@ Your Google account may have other forms
@@ -948,6 +948,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>
@ -483,7 +584,53 @@ Enable incognito custom tabs and fix crashes for incognito/custom tab intents (c
+ </message>
+ <message name="IDS_ALWAYS_INCOGNITO_SUMMARY" desc="Summary for always incognito mode">
+ Opens links in incognito tabs when you click on new tab or on a link
+ </message>
+ <message name="IDS_RELAUNCH" desc="Summary for always incognito mode">
+ Relaunch
+ </message>
+ <message name="IDS_UI_RELAUNCH_NOTICE" desc="Summary for always incognito mode">
+ Your changes will take effect the next time you relaunch Bromite.
+ </message>
<message name="IDS_CLEAR_BROWSING_HISTORY_SUMMARY_SIGNED_IN" desc="A text explaining other forms of activity for signed in users.">
Clears history and autocompletions in the address bar. Your Google Account may have other forms of browsing history at <ph name="BEGIN_LINK">&lt;link&gt;</ph>myactivity.9oo91e.qjz9zk<ph name="END_LINK">&lt;/link&gt;</ph>.
</message>
--- a/chrome/browser/ui/messages/android/BUILD.gn
+++ b/chrome/browser/ui/messages/android/BUILD.gn
@@ -22,6 +22,7 @@ android_resources("java_resources") {
android_library("java") {
sources = [
"java/src/org/chromium/chrome/browser/ui/messages/infobar/SimpleConfirmInfoBarBuilder.java",
+ "java/src/org/chromium/chrome/browser/ui/messages/snackbar/INeedSnackbarManager.java",
"java/src/org/chromium/chrome/browser/ui/messages/snackbar/Snackbar.java",
"java/src/org/chromium/chrome/browser/ui/messages/snackbar/SnackbarCollection.java",
"java/src/org/chromium/chrome/browser/ui/messages/snackbar/SnackbarManager.java",
--- /dev/null
+++ b/chrome/browser/ui/messages/android/java/src/org/chromium/chrome/browser/ui/messages/snackbar/INeedSnackbarManager.java
@@ -0,0 +1,27 @@
+/*
+ This file is part of Bromite.
+
+ Bromite is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ Bromite is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with Bromite. If not, see <https://www.gnu.org/licenses/>.
+*/
+
+package org.chromium.chrome.browser.ui.messages.snackbar;
+
+import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager;
+
+/**
+ * An interface that allows using snackbars in the settings
+ */
+public interface INeedSnackbarManager {
+ void setSnackbarManager(SnackbarManager manager);
+}

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

@ -14,17 +14,17 @@ Completely remove contacts picker permission from the file dialog
chrome/android/java/src/org/chromium/chrome/browser/TabbedModeTabDelegateFactory.java | 5
chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkActionBar.java | 12
chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkActivity.java | 30 +
chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkBridge.java | 277 +++++++++
chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkBridge.java | 279 +++++++++
chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkDelegate.java | 10
chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkManager.java | 22
chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkPage.java | 8
chrome/android/java/src/org/chromium/chrome/browser/native_page/NativePageFactory.java | 11
chrome/browser/BUILD.gn | 11
chrome/browser/BUILD.gn | 9
chrome/browser/about_flags.cc | 6
chrome/browser/android/bookmarks/bookmark_bridge.cc | 284 ++++++++++
chrome/browser/android/bookmarks/bookmark_bridge.h | 28
chrome/browser/android/bookmarks/bookmark_bridge.h | 29 -
chrome/browser/bookmarks/bookmark_html_writer.cc | 8
chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationCustomView.java | 8
chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationCustomView.java | 12
chrome/browser/download/android/java/src/org/chromium/chrome/browser/download/dialogs/DownloadLocationDialogCoordinator.java | 8
chrome/browser/flag_descriptions.cc | 5
chrome/browser/flag_descriptions.h | 3
@ -44,7 +44,7 @@ Completely remove contacts picker permission from the file dialog
ui/shell_dialogs/select_file_dialog.h | 2
ui/shell_dialogs/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, 895 insertions(+), 29 deletions(-)
--- a/base/android/content_uri_utils.cc
+++ b/base/android/content_uri_utils.cc
@ -67,7 +67,7 @@ Completely remove contacts picker permission from the file dialog
ScopedJavaLocalRef<jstring> j_uri =
--- a/base/android/content_uri_utils.h
+++ b/base/android/content_uri_utils.h
@@ -17,6 +17,10 @@ namespace base {
@@ -18,6 +18,10 @@ namespace base {
// Returns -1 if the URI is invalid.
BASE_EXPORT File OpenContentUriForRead(const FilePath& content_uri);
@ -140,7 +140,7 @@ Completely remove contacts picker permission from the file dialog
+++ b/chrome/android/java/res/menu/bookmark_action_bar_menu.xml
@@ -29,6 +29,20 @@
app:showAsAction="ifRoom"
app:iconTint="@color/default_icon_color_tint_list" />
app:iconTint="@color/default_icon_color_secondary_tint_list" />
<item
+ android:id="@+id/import_menu_id"
+ android:icon="@drawable/ic_folder_blue_24dp"
@ -189,7 +189,7 @@ Completely remove contacts picker permission from the file dialog
Supplier<EphemeralTabCoordinator> ephemeralTabCoordinatorSupplier,
--- a/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkActionBar.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/bookmarks/BookmarkActionBar.java
@@ -86,6 +86,12 @@ public class BookmarkActionBar extends S
@@ -88,6 +88,12 @@ public class BookmarkActionBar extends S
} else if (menuItem.getItemId() == R.id.search_menu_id) {
mDelegate.openSearchUI();
return true;
@ -202,7 +202,7 @@ Completely remove contacts picker permission from the file dialog
}
SelectionDelegate<BookmarkId> selectionDelegate = mDelegate.getSelectionDelegate();
@@ -137,6 +143,8 @@ public class BookmarkActionBar extends S
@@ -139,6 +145,8 @@ public class BookmarkActionBar extends S
void showLoadingUi() {
setTitle(null);
setNavigationButton(NAVIGATION_BUTTON_NONE);
@ -211,7 +211,7 @@ 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);
@@ -147,6 +155,8 @@ public class BookmarkActionBar extends S
@@ -149,6 +157,8 @@ public class BookmarkActionBar extends S
super.showNormalView();
if (mDelegate == null) {
@ -220,7 +220,7 @@ 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);
@@ -178,6 +188,8 @@ public class BookmarkActionBar extends S
@@ -180,6 +190,8 @@ public class BookmarkActionBar extends S
public void onFolderStateSet(BookmarkId folder) {
mCurrentFolder = mDelegate.getModel().getBookmarkById(folder);
@ -280,7 +280,7 @@ Completely remove contacts picker permission from the file dialog
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
+ mWindowAndroid.getIntentRequestTracker().onActivityResult(requestCode, resultCode, data, mWindowAndroid);
+ mWindowAndroid.getIntentRequestTracker().onActivityResult(requestCode, resultCode, data);
if (requestCode == EDIT_BOOKMARK_REQUEST_CODE && resultCode == RESULT_OK) {
BookmarkId bookmarkId = BookmarkId.getBookmarkIdFromString(data.getStringExtra(
INTENT_VISIT_BOOKMARK_ID));
@ -301,10 +301,11 @@ Completely remove contacts picker permission from the file dialog
*/
--- 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;
@ -321,7 +322,7 @@ Completely remove contacts picker permission from the file dialog
import android.text.TextUtils;
import android.util.Pair;
@@ -27,8 +39,33 @@ import org.chromium.components.url_forma
@@ -30,8 +43,33 @@ import org.chromium.components.url_forma
import org.chromium.content_public.browser.WebContents;
import org.chromium.url.GURL;
@ -355,7 +356,7 @@ Completely remove contacts picker permission from the file dialog
/**
* Provides the communication channel for Android to fetch and manipulate the
@@ -587,6 +624,210 @@ public class BookmarkBridge {
@@ -590,6 +628,211 @@ public class BookmarkBridge {
}
/**
@ -408,7 +409,7 @@ Completely remove contacts picker permission from the file dialog
+ window.showIntent(fileSelector,
+ new WindowAndroid.IntentCallback() {
+ @Override
+ public void onIntentCompleted(WindowAndroid window, int resultCode, Intent data) {
+ public void onIntentCompleted(int resultCode, Intent data) {
+ if (data == null) return;
+ Uri filePath = data.getData();
+ doExportBookmarksImpl(window, filePath);
@ -506,22 +507,23 @@ Completely remove contacts picker permission from the file dialog
+ 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.POSITIVE_BUTTON_DISABLED, false)
+ .with(ModalDialogProperties.NEGATIVE_BUTTON_TEXT, resources,
+ R.string.cancel)
+ .with(ModalDialogProperties.NEGATIVE_BUTTON_DISABLED, false)
+ .build();
+
+ mModalDialogManager.showDialog(mDialogModel, ModalDialogManager.ModalDialogType.APP);
@ -558,15 +560,15 @@ Completely remove contacts picker permission from the file dialog
+ }
+ };
+ dialog.initialize(controller);
+ dialog.showDialog(context, modalDialogManager, /*totalBytes*/ 0,
+ DownloadLocationDialogType.DEFAULT, /*suggestedPath*/ "");
+ dialog.showDialog(context, modalDialogManager, /*totalBytes*/ 0l,
+ DownloadLocationDialogType.DEFAULT, /*suggestedPath*/ "", true);
+ }
+
+ /**
* 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.
@@ -1022,6 +1263,39 @@ public class BookmarkBridge {
@@ -1101,6 +1344,39 @@ public class BookmarkBridge {
depthList.add(depth);
}
@ -606,7 +608,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++) {
@@ -1089,6 +1363,9 @@ public class BookmarkBridge {
@@ -1168,6 +1444,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);
@ -655,7 +657,7 @@ Completely remove contacts picker permission from the file dialog
private BookmarkUndoController mUndoController;
private final ObserverList<BookmarkUIObserver> mUIObservers = new ObserverList<>();
private BasicNativePage mNativePage;
@@ -332,6 +336,14 @@ public class BookmarkManager
@@ -342,6 +346,14 @@ public class BookmarkManager
}
/**
@ -670,7 +672,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)}.
@@ -510,6 +522,16 @@ public class BookmarkManager
@@ -522,6 +534,16 @@ public class BookmarkManager
}
@Override
@ -735,7 +737,7 @@ Completely remove contacts picker permission from the file dialog
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;
@ -744,7 +746,7 @@ Completely remove contacts picker permission from the file dialog
@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 {
@ -753,7 +755,7 @@ Completely remove contacts picker permission from the file dialog
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;
@ -762,7 +764,7 @@ Completely remove contacts picker permission from the file dialog
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(),
@ -773,7 +775,7 @@ Completely remove contacts picker permission from the file dialog
protected NativePage buildDownloadsPage(Tab tab) {
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -1834,6 +1834,13 @@ static_library("browser") {
@@ -1860,6 +1860,13 @@ static_library("browser") {
"window_placement/window_placement_permission_context.h",
]
@ -787,7 +789,7 @@ Completely remove contacts picker permission from the file dialog
configs += [
"//build/config/compiler:wexit_time_destructors",
"//build/config:precompiled_headers",
@@ -2960,6 +2967,8 @@ static_library("browser") {
@@ -2995,6 +3002,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",
@ -796,20 +798,11 @@ Completely remove contacts picker permission from the file dialog
"browser_process_platform_part_android.cc",
"browser_process_platform_part_android.h",
"chrome_browser_field_trials_mobile.cc",
@@ -3515,8 +3524,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",
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -7545,6 +7545,12 @@ const FeatureEntry kFeatureEntries[] = {
FEATURE_VALUE_TYPE(
password_manager::features::kPasswordsAccountStorageRevisedOptInFlow)},
@@ -7706,6 +7706,12 @@ const FeatureEntry kFeatureEntries[] = {
FEATURE_VALUE_TYPE(ui::kLibinputHandleTouchpad)},
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
+ {"export-bookmarks-use-saf",
+ flag_descriptions::kBookmarksExportUseSafName,
@ -822,7 +815,7 @@ 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
@@ -39,6 +39,7 @@
@@ -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"
@ -830,7 +823,7 @@ Completely remove contacts picker permission from the file dialog
#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 @@
@@ -52,6 +53,24 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/web_contents.h"
@ -855,7 +848,7 @@ Completely remove contacts picker permission from the file dialog
using base::android::AttachCurrentThread;
using base::android::ConvertUTF8ToJavaString;
using base::android::ConvertUTF16ToJavaString;
@@ -64,8 +83,93 @@ using bookmarks::BookmarkNode;
@@ -68,8 +87,93 @@ using bookmarks::BookmarkNode;
using bookmarks::BookmarkType;
using content::BrowserThread;
@ -949,7 +942,7 @@ Completely remove contacts picker permission from the file dialog
const int kInvalidId = -1;
class BookmarkTitleComparer {
@@ -152,6 +256,10 @@ BookmarkBridge::~BookmarkBridge() {
@@ -156,6 +260,10 @@ BookmarkBridge::~BookmarkBridge() {
if (partner_bookmarks_shim_)
partner_bookmarks_shim_->RemoveObserver(this);
reading_list_manager_->RemoveObserver(this);
@ -960,7 +953,7 @@ Completely remove contacts picker permission from the file dialog
}
void BookmarkBridge::Destroy(JNIEnv*, const JavaParamRef<jobject>&) {
@@ -543,6 +651,182 @@ jint BookmarkBridge::GetTotalBookmarkCou
@@ -547,6 +655,182 @@ jint BookmarkBridge::GetTotalBookmarkCou
return count;
}
@ -1173,7 +1166,7 @@ Completely remove contacts picker permission from the file dialog
public:
BookmarkBridge(JNIEnv* env,
const base::android::JavaRef<jobject>& obj,
@@ -55,6 +60,12 @@ class BookmarkBridge : public bookmarks:
@@ -59,6 +64,12 @@ class BookmarkBridge : public bookmarks:
bool IsDoingExtensiveChanges(JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj);
@ -1186,7 +1179,7 @@ Completely remove contacts picker permission from the file dialog
jboolean IsEditBookmarksEnabled(JNIEnv* env);
void LoadEmptyPartnerBookmarkShimForTesting(
@@ -142,6 +153,15 @@ class BookmarkBridge : public bookmarks:
@@ -146,6 +157,15 @@ class BookmarkBridge : public bookmarks:
jlong id,
jint type);
@ -1202,7 +1195,7 @@ Completely remove contacts picker permission from the file dialog
void SetBookmarkTitle(JNIEnv* env,
const base::android::JavaParamRef<jobject>& obj,
jlong id,
@@ -315,12 +335,15 @@ class BookmarkBridge : public bookmarks:
@@ -347,12 +367,15 @@ class BookmarkBridge : public bookmarks:
void DestroyJavaObject();
Profile* profile_;
@ -1218,16 +1211,17 @@ Completely remove contacts picker permission from the file dialog
// Information about the Partner bookmarks (must check for IsLoaded()).
// This is owned by profile.
@@ -332,6 +355,9 @@ class BookmarkBridge : public bookmarks:
@@ -363,6 +386,10 @@ class BookmarkBridge : public bookmarks:
// 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);
};
#endif // CHROME_BROWSER_ANDROID_BOOKMARKS_BOOKMARK_BRIDGE_H_
--- a/chrome/browser/bookmarks/bookmark_html_writer.cc
+++ b/chrome/browser/bookmarks/bookmark_html_writer.cc
@@ -27,6 +27,7 @@
@ -1238,7 +1232,7 @@ Completely remove contacts picker permission from the file dialog
#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::RefCountedTh
@@ -235,7 +236,12 @@ class Writer : public base::RefCountedTh
// Opens the file, returning true on success.
bool OpenFile() {
int flags = base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE;
@ -1254,7 +1248,7 @@ Completely remove contacts picker permission from the file dialog
return false;
--- 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;
@ -1263,7 +1257,7 @@ Completely remove contacts picker permission from the file dialog
private @DownloadLocationDialogType int mDialogType;
private long mTotalBytes;
@@ -68,7 +68,7 @@ public class DownloadLocationCustomView
@@ -72,14 +72,14 @@ public class DownloadLocationCustomView
mDontShowAgain = findViewById(R.id.show_again_checkbox);
}
@ -1272,7 +1266,24 @@ Completely remove contacts picker permission from the file dialog
// TODO(xingliu): Remove this function, currently used by smart suggestion.
mDialogType = dialogType;
mTotalBytes = totalBytes;
@@ -117,7 +117,7 @@ public class DownloadLocationCustomView
mDirectoryAdapter.update();
}
- void setTitle(CharSequence title) {
+ public void setTitle(CharSequence title) {
mTitle.setText(title);
}
@@ -87,7 +87,7 @@ public class DownloadLocationCustomView
mSubtitleView.setText(subtitle);
}
- void setFileName(CharSequence fileName) {
+ public void setFileName(CharSequence fileName) {
mFileName.setText(fileName);
}
@@ -125,7 +125,7 @@ public class DownloadLocationCustomView
* @return The text that the user inputted as the name of the file.
*/
@Nullable
@ -1281,7 +1292,7 @@ Completely remove contacts picker permission from the file dialog
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
@ -1292,7 +1303,7 @@ Completely remove contacts picker permission from the file dialog
return selected;
--- 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;
@ -1308,7 +1319,7 @@ Completely remove contacts picker permission from the file dialog
private long mTotalBytes;
private @DownloadLocationDialogType int mDialogType;
private String mSuggestedPath;
@@ -127,7 +127,7 @@ public class DownloadLocationDialogCoord
@@ -131,7 +131,7 @@ public class DownloadLocationDialogCoord
* Called after retrieved the download directory options.
* @param dirs An list of available download directories.
*/
@ -1316,10 +1327,10 @@ Completely remove contacts picker permission from the file dialog
+ protected 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.
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -5300,6 +5300,11 @@ const char kWebKioskEnableLacrosDescript
@@ -5472,6 +5472,11 @@ const char kWebKioskEnableLacrosDescript
"Chrome OS. When disabled, the Ash-chrome will be used";
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
@ -1333,7 +1344,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
@@ -3088,6 +3088,9 @@ extern const char kWebKioskEnableLacrosN
@@ -3185,6 +3185,9 @@ extern const char kWebKioskEnableLacrosN
extern const char kWebKioskEnableLacrosDescription[];
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
@ -1345,7 +1356,7 @@ 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
@@ -164,6 +164,7 @@ const base::Feature* const kFeaturesExpo
@@ -174,6 +174,7 @@ const base::Feature* const kFeaturesExpo
&kBackgroundThreadPool,
&kBentoOffline,
&kBookmarkBottomSheet,
@ -1353,7 +1364,7 @@ Completely remove contacts picker permission from the file dialog
&kCastDeviceFilter,
&kCloseTabSuggestions,
&kCriticalPersistedTabData,
@@ -810,6 +811,10 @@ const base::Feature kWebApkInstallComple
@@ -824,6 +825,10 @@ const base::Feature kWebApkInstallComple
const base::Feature kWebApkTrampolineOnInitialIntent{
"WebApkTrampolineOnInitialIntent", base::FEATURE_ENABLED_BY_DEFAULT};
@ -1366,7 +1377,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
@@ -146,6 +146,7 @@ extern const base::Feature kToolbarMicIp
@@ -149,6 +149,7 @@ extern const base::Feature kToolbarMicIp
extern const base::Feature kToolbarUseHardwareBitmapDraw;
extern