Compare commits

..
Author SHA1 Message Date
Carmelo Messina e17e51acb3 fix rearrange tab order issue, fix omnibox-modernize-visual-update 2023-02-02 12:20:41 +01:00
Carmelo MessinaandCarl 6f40f8341a Use helper macros to define base::Features
see https://bugs.chromium.org/p/chromium/issues/detail?id=1364289
2023-01-28 00:57:29 +01:00
Carmelo MessinaandCarl 97ee58b5ae Restoring ua reduction 2023-01-28 00:54:16 +01:00
Carmelo MessinaandCarl 52e270dc86 fix some lost changes 2023-01-27 11:33:41 +01:00
Carmelo MessinaandCarl a4b741525d Fixes the order of the tabs in the tablist 2023-01-27 11:31:23 +01:00
Mikhail KrassavinandCarl 3b786d51d9 Increase maximum adblock filter file size to 20MB
I've made my own generated filter file, which doesn't fit into 10MB. The author of [filtrite](https://github.com/xarantolus/filtrite#using-your-own-filter-lists) also mentions this limitation. Hopefully, 20 MB is more than enough for everyone.
2023-01-27 11:22:16 +01:00
23 changed files with 601 additions and 781 deletions
@@ -30,9 +30,9 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
gpu/config/gpu_workaround_list.txt | 1 +
gpu/ipc/service/gpu_init.cc | 5 +++++
gpu/ipc/service/stream_texture_android.cc | 11 ++++++++++-
media/base/media_switches.cc | 4 ++++
media/base/media_switches.cc | 5 +++++
media/base/media_switches.h | 1 +
12 files changed, 65 insertions(+), 5 deletions(-)
12 files changed, 66 insertions(+), 5 deletions(-)
diff --git a/base/android/android_image_reader_compat.cc b/base/android/android_image_reader_compat.cc
--- a/base/android/android_image_reader_compat.cc
@@ -231,13 +231,14 @@ diff --git a/gpu/ipc/service/stream_texture_android.cc b/gpu/ipc/service/stream_
diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc
--- a/media/base/media_switches.cc
+++ b/media/base/media_switches.cc
@@ -750,6 +750,10 @@ BASE_FEATURE(kHardwareSecureDecryptionExperiment,
@@ -750,6 +750,11 @@ BASE_FEATURE(kHardwareSecureDecryptionExperiment,
// Allows automatically disabling hardware secure Content Decryption Module
// (CDM) after failures or crashes to fallback to software secure CDMs. If this
// feature is disabled, the fallback will never happen and users could be stuck
+// Enables the Android Image Reader path for Video decoding(for AVDA and MCVD)
+const base::Feature kAImageReaderVideoOutput{"AImageReaderVideoOutput",
+ base::FEATURE_ENABLED_BY_DEFAULT};
+BASE_FEATURE(kAImageReaderVideoOutput,
+ "AImageReaderVideoOutput",
+ base::FEATURE_ENABLED_BY_DEFAULT);
+
// in playback failures.
BASE_FEATURE(kHardwareSecureDecryptionFallback,
@@ -249,7 +250,7 @@ diff --git a/media/base/media_switches.h b/media/base/media_switches.h
MEDIA_EXPORT BASE_DECLARE_FEATURE(kVaapiVp9kSVCHWEncoding);
#endif // defined(ARCH_CPU_X86_FAMILY) && BUILDFLAG(IS_CHROMEOS)
MEDIA_EXPORT BASE_DECLARE_FEATURE(kVideoBlitColorAccuracy);
+MEDIA_EXPORT extern const base::Feature kAImageReaderVideoOutput;
+MEDIA_EXPORT BASE_DECLARE_FEATURE(kAImageReaderVideoOutput);
MEDIA_EXPORT BASE_DECLARE_FEATURE(kVp9kSVCHWDecoding);
MEDIA_EXPORT BASE_DECLARE_FEATURE(kWakeLockOptimisationHiddenMuted);
MEDIA_EXPORT BASE_DECLARE_FEATURE(kWebContentsCaptureHiDpi);
@@ -115,14 +115,14 @@ diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browse
diff --git a/chrome/browser/flags/android/chrome_feature_list.h b/chrome/browser/flags/android/chrome_feature_list.h
--- a/chrome/browser/flags/android/chrome_feature_list.h
+++ b/chrome/browser/flags/android/chrome_feature_list.h
@@ -12,6 +12,7 @@
namespace chrome {
namespace android {
+extern const base::Feature kAllowUserCertificates;
// Alphabetical:
BASE_DECLARE_FEATURE(kAdaptiveButtonInTopToolbar);
@@ -17,6 +17,7 @@ BASE_DECLARE_FEATURE(kAdaptiveButtonInTopToolbar);
BASE_DECLARE_FEATURE(kAdaptiveButtonInTopToolbarCustomizationV2);
BASE_DECLARE_FEATURE(kAddToHomescreenIPH);
BASE_DECLARE_FEATURE(kAllowNewIncognitoTabIntents);
+BASE_DECLARE_FEATURE(kAllowUserCertificates);
BASE_DECLARE_FEATURE(kAndroidScrollOptimizations);
BASE_DECLARE_FEATURE(kAndroidSearchEngineChoiceNotification);
BASE_DECLARE_FEATURE(kAssistantConsentModal);
diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java
--- a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java
+++ b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/CachedFeatureFlags.java
@@ -8,10 +8,10 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
chrome/browser/about_flags.cc | 4 ++++
chrome/browser/flag_descriptions.cc | 4 ++++
chrome/browser/flag_descriptions.h | 3 +++
net/base/features.cc | 3 +++
net/base/features.cc | 4 ++++
net/base/features.h | 2 ++
net/url_request/url_request_http_job.cc | 4 ++++
6 files changed, 20 insertions(+)
6 files changed, 21 insertions(+)
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
--- a/chrome/browser/about_flags.cc
@@ -57,12 +57,13 @@ diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptio
diff --git a/net/base/features.cc b/net/base/features.cc
--- a/net/base/features.cc
+++ b/net/base/features.cc
@@ -113,6 +113,9 @@ BASE_FEATURE(kPartitionNelAndReportingByNetworkIsolationKey,
@@ -113,6 +113,10 @@ BASE_FEATURE(kPartitionNelAndReportingByNetworkIsolationKey,
"PartitionNelAndReportingByNetworkIsolationKey", // must be enabled
base::FEATURE_ENABLED_BY_DEFAULT); // in Bromite
+const base::Feature kIsCleartextPermitted{"IsCleartextPermitted",
+ base::FEATURE_ENABLED_BY_DEFAULT};
+BASE_FEATURE(kIsCleartextPermitted,
+ "IsCleartextPermitted",
+ base::FEATURE_ENABLED_BY_DEFAULT);
+
BASE_FEATURE(kEnableDoubleKeyNetworkAnonymizationKey,
"EnableDoubleKeyNetworkAnonymizationKey",
@@ -74,7 +75,7 @@ diff --git a/net/base/features.h b/net/base/features.h
// origin requests are restricted to contain at most the source origin.
NET_EXPORT BASE_DECLARE_FEATURE(kCapReferrerToOriginOnCrossOrigin);
+NET_EXPORT extern const base::Feature kIsCleartextPermitted;
+NET_EXPORT BASE_DECLARE_FEATURE(kIsCleartextPermitted);
+
// Support for altering the parameters used for DNS transaction timeout. See
// ResolveContext::SecureTransactionTimeout().
@@ -1306,7 +1306,7 @@ diff --git a/chrome/browser/flags/android/chrome_feature_list.h b/chrome/browser
BASE_DECLARE_FEATURE(kTabStripRedesign);
BASE_DECLARE_FEATURE(kTabSwitcherOnReturn);
BASE_DECLARE_FEATURE(kTabToGTSAnimation);
+extern const base::Feature kBookmarksExportUseSaf;
+BASE_DECLARE_FEATURE(kBookmarksExportUseSaf);
BASE_DECLARE_FEATURE(kTestDefaultDisabled);
BASE_DECLARE_FEATURE(kTestDefaultEnabled);
BASE_DECLARE_FEATURE(kToolbarMicIphAndroid);
@@ -9,8 +9,8 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
chrome/browser/flag_descriptions.h | 3 +++
.../browser/loader/browser_initiated_resource_request.cc | 8 ++++++++
services/network/public/cpp/features.cc | 5 +++++
services/network/public/cpp/features.h | 3 ++-
6 files changed, 26 insertions(+), 2 deletions(-)
services/network/public/cpp/features.h | 2 +-
6 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
--- a/chrome/browser/about_flags.cc
@@ -88,10 +88,10 @@ diff --git a/services/network/public/cpp/features.cc b/services/network/public/c
"ExpectCTReporting",
base::FEATURE_ENABLED_BY_DEFAULT);
+
+// Enable save-data header separately (without enabled data reduction service).
+const base::Feature kEnableSaveDataHeader{"EnableSaveDataHeader",
+ base::FEATURE_DISABLED_BY_DEFAULT};
+BASE_FEATURE(kEnableSaveDataHeader,
+ "EnableSaveDataHeader",
+ base::FEATURE_DISABLED_BY_DEFAULT);
+
BASE_FEATURE(kNetworkErrorLogging,
"NetworkErrorLogging",
@@ -99,13 +99,12 @@ diff --git a/services/network/public/cpp/features.cc b/services/network/public/c
diff --git a/services/network/public/cpp/features.h b/services/network/public/cpp/features.h
--- a/services/network/public/cpp/features.h
+++ b/services/network/public/cpp/features.h
@@ -51,7 +51,8 @@ extern const base::FeatureParam<TrustTokenOriginTrialSpec>
@@ -50,7 +50,7 @@ extern const base::FeatureParam<TrustTokenOriginTrialSpec>
kTrustTokenOperationsRequiringOriginTrial;
COMPONENT_EXPORT(NETWORK_CPP)
extern const base::FeatureParam<bool> kPlatformProvidedTrustTokenIssuance;
-
+COMPONENT_EXPORT(NETWORK_CPP)
+extern const base::Feature kEnableSaveDataHeader;
+COMPONENT_EXPORT(NETWORK_CPP) BASE_DECLARE_FEATURE(kEnableSaveDataHeader);
COMPONENT_EXPORT(NETWORK_CPP)
BASE_DECLARE_FEATURE(kWebSocketReassembleShortMessages);
@@ -10,8 +10,8 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
components/subresource_filter/tools/BUILD.gn | 6 ++++++
.../url_formatter/spoof_checks/top_domains/BUILD.gn | 3 ++-
net/dns/host_resolver_manager.cc | 9 ++++++++-
services/network/public/cpp/features.cc | 4 ++++
services/network/public/cpp/features.h | 2 ++
services/network/public/cpp/features.cc | 5 +++++
services/network/public/cpp/features.h | 1 +
8 files changed, 33 insertions(+), 2 deletions(-)
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
@@ -128,13 +128,14 @@ diff --git a/net/dns/host_resolver_manager.cc b/net/dns/host_resolver_manager.cc
diff --git a/services/network/public/cpp/features.cc b/services/network/public/cpp/features.cc
--- a/services/network/public/cpp/features.cc
+++ b/services/network/public/cpp/features.cc
@@ -38,6 +38,10 @@ BASE_FEATURE(kThrottleDelayable,
@@ -38,6 +38,11 @@ BASE_FEATURE(kThrottleDelayable,
"ThrottleDelayable",
base::FEATURE_ENABLED_BY_DEFAULT);
+// Enable IPv6 ping probes to RIPE DNS.
+const base::Feature kIPv6Probing{"IPv6Probing",
+ base::FEATURE_ENABLED_BY_DEFAULT};
+BASE_FEATURE(kIPv6Probing,
+ "IPv6Probing",
+ base::FEATURE_ENABLED_BY_DEFAULT);
+
// When kPriorityRequestsDelayableOnSlowConnections is enabled, HTTP
// requests fetched from a SPDY/QUIC/H2 proxies can be delayed by the
@@ -142,14 +143,13 @@ diff --git a/services/network/public/cpp/features.cc b/services/network/public/c
diff --git a/services/network/public/cpp/features.h b/services/network/public/cpp/features.h
--- a/services/network/public/cpp/features.h
+++ b/services/network/public/cpp/features.h
@@ -18,6 +18,8 @@ COMPONENT_EXPORT(NETWORK_CPP) BASE_DECLARE_FEATURE(kNetworkErrorLogging);
@@ -17,6 +17,7 @@ COMPONENT_EXPORT(NETWORK_CPP) BASE_DECLARE_FEATURE(kExpectCTReporting);
COMPONENT_EXPORT(NETWORK_CPP) BASE_DECLARE_FEATURE(kNetworkErrorLogging);
COMPONENT_EXPORT(NETWORK_CPP) BASE_DECLARE_FEATURE(kReporting);
COMPONENT_EXPORT(NETWORK_CPP) BASE_DECLARE_FEATURE(kThrottleDelayable);
+COMPONENT_EXPORT(NETWORK_CPP) BASE_DECLARE_FEATURE(kIPv6Probing);
COMPONENT_EXPORT(NETWORK_CPP)
+extern const base::Feature kIPv6Probing;
+COMPONENT_EXPORT(NETWORK_CPP)
BASE_DECLARE_FEATURE(kDelayRequestsOnMultiplexedConnections);
COMPONENT_EXPORT(NETWORK_CPP)
BASE_DECLARE_FEATURE(kPauseBrowserInitiatedHeavyTrafficForP2P);
--
2.25.1
@@ -4,17 +4,17 @@ Subject: Add flag to disable vibration
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
---
chrome/browser/about_flags.cc | 4 ++++
chrome/browser/flag_descriptions.cc | 3 +++
chrome/browser/flag_descriptions.h | 2 ++
content/child/runtime_features.cc | 1 +
content/public/common/content_features.cc | 4 ++++
content/public/common/content_features.h | 2 ++
third_party/blink/public/platform/web_runtime_features.h | 1 +
.../blink/renderer/modules/vibration/vibration_controller.cc | 3 +++
.../blink/renderer/platform/exported/web_runtime_features.cc | 4 ++++
.../blink/renderer/platform/runtime_enabled_features.json5 | 4 ++++
10 files changed, 28 insertions(+)
chrome/browser/about_flags.cc | 4 ++++
chrome/browser/flag_descriptions.cc | 3 +++
chrome/browser/flag_descriptions.h | 2 ++
content/child/runtime_features.cc | 1 +
content/public/common/content_features.cc | 5 +++++
content/public/common/content_features.h | 2 ++
third_party/blink/public/platform/web_runtime_features.h | 1 +
.../blink/renderer/modules/vibration/vibration_controller.cc | 3 +++
.../blink/renderer/platform/exported/web_runtime_features.cc | 4 ++++
.../blink/renderer/platform/runtime_enabled_features.json5 | 4 ++++
10 files changed, 29 insertions(+)
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
--- a/chrome/browser/about_flags.cc
@@ -69,13 +69,14 @@ diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.
diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc
--- a/content/public/common/content_features.cc
+++ b/content/public/common/content_features.cc
@@ -130,6 +130,10 @@ BASE_FEATURE(kBackForwardCacheMemoryControls,
@@ -130,6 +130,11 @@ BASE_FEATURE(kBackForwardCacheMemoryControls,
#endif
);
+// Enables vibration; an user gesture will still be required if enabled.
+const base::Feature kVibration{"Vibration",
+ base::FEATURE_DISABLED_BY_DEFAULT};
+BASE_FEATURE(kVibration,
+ "Vibration",
+ base::FEATURE_DISABLED_BY_DEFAULT);
+
// When this feature is enabled, private network requests initiated from
// non-secure contexts in the `public` address space are blocked.
@@ -87,7 +88,7 @@ diff --git a/content/public/common/content_features.h b/content/public/common/co
kCompositorLockTimeout;
#endif // BUILDFLAG(IS_ANDROID)
+CONTENT_EXPORT extern const base::Feature kVibration;
+CONTENT_EXPORT BASE_DECLARE_FEATURE(kVibration);
+
#if BUILDFLAG(IS_MAC)
@@ -491,14 +491,14 @@ diff --git a/components/bookmarks/browser/bookmark_codec.cc b/components/bookmar
diff --git a/components/bookmarks/browser/bookmark_codec.h b/components/bookmarks/browser/bookmark_codec.h
--- a/components/bookmarks/browser/bookmark_codec.h
+++ b/components/bookmarks/browser/bookmark_codec.h
@@ -48,6 +48,7 @@ class BookmarkCodec {
base::Value Encode(
@@ -49,6 +49,7 @@ class BookmarkCodec {
const BookmarkNode* bookmark_bar_node,
const BookmarkNode* other_folder_node,
+ const BookmarkNode* tabs_folder_node,
const BookmarkNode* mobile_folder_node,
+ const BookmarkNode* tabs_folder_node,
const BookmarkNode::MetaInfoMap* model_meta_info_map,
const BookmarkNode::MetaInfoMap* model_unsynced_meta_info_map,
std::string sync_metadata_str);
@@ -62,6 +63,7 @@ class BookmarkCodec {
BookmarkNode* bb_node,
BookmarkNode* other_folder_node,
+1 -1
View File
@@ -1277,7 +1277,7 @@ diff --git a/chrome/browser/flags/android/chrome_feature_list.h b/chrome/browser
BASE_DECLARE_FEATURE(kHandleMediaIntents);
BASE_DECLARE_FEATURE(kImmersiveUiMode);
BASE_DECLARE_FEATURE(kIncognitoReauthenticationForAndroid);
+extern const base::Feature kInlineUpdateFlow;
+BASE_DECLARE_FEATURE(kInlineUpdateFlow);
BASE_DECLARE_FEATURE(kIncognitoScreenshot);
BASE_DECLARE_FEATURE(kInfobarScrollOptimization);
BASE_DECLARE_FEATURE(kImprovedA2HS);
@@ -1157,8 +1157,8 @@ new file mode 100644
+
+namespace adblock_updater {
+
+// maximum 10MB for the filters file
+const int kMaxBodySize = 1024 * 1024 * 10;
+// maximum 20MB for the filters file
+const int kMaxBodySize = 1024 * 1024 * 20;
+
+const int kMaxRetriesOnNetworkChange = 3;
+
+11 -9
View File
@@ -28,13 +28,13 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
chrome/browser/about_flags.cc | 6 +++
chrome/browser/flag_descriptions.cc | 8 ++++
chrome/browser/flag_descriptions.h | 6 +++
net/base/features.cc | 6 +++
net/base/features.cc | 8 ++++
net/base/features.h | 6 +++
net/http/http_network_session.cc | 1 +
net/quic/quic_stream_factory.cc | 35 ++++++++++++++++-
net/socket/ssl_client_socket_impl.cc | 59 ++++++++++++++++++++++++++++
net/socket/ssl_client_socket_impl.h | 2 +
9 files changed, 128 insertions(+), 1 deletion(-)
9 files changed, 130 insertions(+), 1 deletion(-)
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
--- a/chrome/browser/about_flags.cc
@@ -89,15 +89,17 @@ diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptio
diff --git a/net/base/features.cc b/net/base/features.cc
--- a/net/base/features.cc
+++ b/net/base/features.cc
@@ -61,6 +61,12 @@ const base::FeatureParam<base::TimeDelta> kUseDnsHttpsSvcbSecureExtraTimeMin{
@@ -61,6 +61,14 @@ const base::FeatureParam<base::TimeDelta> kUseDnsHttpsSvcbSecureExtraTimeMin{
&kUseDnsHttpsSvcb, "UseDnsHttpsSvcbSecureExtraTimeMin",
base::Milliseconds(5)};
+const base::Feature kDisableTLSResumption{"DisableTLSResumption",
+ base::FEATURE_ENABLED_BY_DEFAULT};
+BASE_FEATURE(kDisableTLSResumption,
+ "DisableTLSResumption",
+ base::FEATURE_ENABLED_BY_DEFAULT);
+
+const base::Feature kLogTLSResumption{"LogTLSResumption",
+ base::FEATURE_DISABLED_BY_DEFAULT};
+BASE_FEATURE(kLogTLSResumption,
+ "LogTLSResumption",
+ base::FEATURE_DISABLED_BY_DEFAULT);
+
BASE_FEATURE(kUseDnsHttpsSvcbAlpn,
"UseDnsHttpsSvcbAlpn",
@@ -110,10 +112,10 @@ diff --git a/net/base/features.h b/net/base/features.h
NET_EXPORT BASE_DECLARE_FEATURE(kEnableTLS13EarlyData);
+// Disables TLS resumption.
+NET_EXPORT extern const base::Feature kDisableTLSResumption;
+NET_EXPORT BASE_DECLARE_FEATURE(kDisableTLSResumption);
+
+// Log TLS resumption.
+NET_EXPORT extern const base::Feature kLogTLSResumption;
+NET_EXPORT BASE_DECLARE_FEATURE(kLogTLSResumption);
+
// Enables the TLS Encrypted ClientHello feature.
// https://datatracker.ietf.org/doc/html/draft-ietf-tls-esni-13
@@ -6,6 +6,7 @@ Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
---
.../chrome_hints_manager.cc | 1 +
.../optimization_guide_keyed_service.cc | 1 -
chrome/common/chrome_features.cc | 8 ++--
.../optimization_guide/core/hints_fetcher.cc | 1 +
.../optimization_guide/core/hints_manager.cc | 5 +++
@@ -15,7 +16,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
components/optimization_guide/features.gni | 4 +-
components/permissions/features.cc | 8 ++--
third_party/blink/common/features.cc | 8 +---
10 files changed, 40 insertions(+), 40 deletions(-)
11 files changed, 40 insertions(+), 41 deletions(-)
diff --git a/chrome/browser/optimization_guide/chrome_hints_manager.cc b/chrome/browser/optimization_guide/chrome_hints_manager.cc
--- a/chrome/browser/optimization_guide/chrome_hints_manager.cc
@@ -28,6 +29,17 @@ diff --git a/chrome/browser/optimization_guide/chrome_hints_manager.cc b/chrome/
if (prediction->prediction_source() !=
NavigationPredictorKeyedService::PredictionSource::
diff --git a/chrome/browser/optimization_guide/optimization_guide_keyed_service.cc b/chrome/browser/optimization_guide/optimization_guide_keyed_service.cc
--- a/chrome/browser/optimization_guide/optimization_guide_keyed_service.cc
+++ b/chrome/browser/optimization_guide/optimization_guide_keyed_service.cc
@@ -320,7 +320,6 @@ void OptimizationGuideKeyedService::RemoveObserverForOptimizationTargetModel(
void OptimizationGuideKeyedService::RegisterOptimizationTypes(
const std::vector<optimization_guide::proto::OptimizationType>&
optimization_types) {
- hints_manager_->RegisterOptimizationTypes(optimization_types);
}
optimization_guide::OptimizationGuideDecision
diff --git a/chrome/common/chrome_features.cc b/chrome/common/chrome_features.cc
--- a/chrome/common/chrome_features.cc
+++ b/chrome/common/chrome_features.cc
@@ -17,11 +17,12 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
.../aggregatable_report_sender.cc | 15 +++++++--------
.../attribution_reporting/attribution_host.cc | 1 +
.../attribution_report_network_sender.cc | 15 ++++++++-------
.../attribution_storage_sql.cc | 8 +++++---
content/browser/storage_partition_impl.cc | 7 +------
content/public/browser/navigation_controller.cc | 1 -
third_party/blink/common/features.cc | 4 ++--
.../platform/runtime_enabled_features.json5 | 7 +++++++
10 files changed, 32 insertions(+), 33 deletions(-)
11 files changed, 37 insertions(+), 36 deletions(-)
diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browser/flags/android/chrome_feature_list.cc
--- a/chrome/browser/flags/android/chrome_feature_list.cc
@@ -142,6 +143,31 @@ diff --git a/content/browser/attribution_reporting/attribution_report_network_se
network::SimpleURLLoader* loader = it->get();
// Consider a non-200 HTTP code as a non-internal error.
diff --git a/content/browser/attribution_reporting/attribution_storage_sql.cc b/content/browser/attribution_reporting/attribution_storage_sql.cc
--- a/content/browser/attribution_reporting/attribution_storage_sql.cc
+++ b/content/browser/attribution_reporting/attribution_storage_sql.cc
@@ -422,6 +422,8 @@ DestinationLimitResult GetDestinationLimitResult(
}
}
+bool g_run_in_memory = true;
+
} // namespace
// static
@@ -433,9 +435,9 @@ bool AttributionStorageSql::DeleteStorageForTesting(
AttributionStorageSql::AttributionStorageSql(
const base::FilePath& user_data_directory,
std::unique_ptr<AttributionStorageDelegate> delegate)
- : path_to_database_(user_data_directory.empty()
- ? base::FilePath()
- : DatabasePath(user_data_directory)),
+ : path_to_database_(user_data_directory.empty() || g_run_in_memory
+ ? base::FilePath()
+ : DatabasePath(user_data_directory)),
delegate_(std::move(delegate)),
rate_limit_table_(delegate_.get()) {
DCHECK(delegate_);
diff --git a/content/browser/storage_partition_impl.cc b/content/browser/storage_partition_impl.cc
--- a/content/browser/storage_partition_impl.cc
+++ b/content/browser/storage_partition_impl.cc
@@ -68,7 +68,7 @@ diff --git a/chrome/browser/flags/android/chrome_feature_list.h b/chrome/browser
BASE_DECLARE_FEATURE(kCacheDeprecatedSystemLocationSetting);
BASE_DECLARE_FEATURE(kChromeNewDownloadTab);
BASE_DECLARE_FEATURE(kChromeShareLongScreenshot);
+extern const base::Feature kChromeSmartSelection;
+BASE_DECLARE_FEATURE(kChromeSmartSelection);
BASE_DECLARE_FEATURE(kChromeShareScreenshot);
BASE_DECLARE_FEATURE(kChromeSharingHub);
BASE_DECLARE_FEATURE(kChromeSharingHubLaunchAdjacent);
@@ -13,11 +13,11 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
chrome/browser/flag_descriptions.h | 3 +++
chrome/browser/ui/prefs/prefs_tab_helper.cc | 2 +-
content/child/runtime_features.cc | 1 +
third_party/blink/common/features.cc | 4 ++++
third_party/blink/common/features.cc | 5 +++++
third_party/blink/public/common/features.h | 1 +
third_party/blink/renderer/core/dom/document.cc | 5 +++++
.../blink/renderer/platform/runtime_enabled_features.json5 | 5 ++---
10 files changed, 31 insertions(+), 4 deletions(-)
10 files changed, 32 insertions(+), 4 deletions(-)
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
--- a/chrome/browser/about_flags.cc
@@ -102,13 +102,14 @@ diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.
diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/features.cc
--- a/third_party/blink/common/features.cc
+++ b/third_party/blink/common/features.cc
@@ -496,6 +496,10 @@ BASE_FEATURE(kDropInputEventsBeforeFirstPaint,
@@ -496,6 +496,11 @@ BASE_FEATURE(kDropInputEventsBeforeFirstPaint,
"DropInputEventsBeforeFirstPaint",
base::FEATURE_DISABLED_BY_DEFAULT);
+// Enable text snippets in URL fragments. https://crbug.com/919204.
+const base::Feature kTextFragmentAnchor{"TextFragmentAnchor",
+ base::FEATURE_DISABLED_BY_DEFAULT};
+BASE_FEATURE(kTextFragmentAnchor,
+ "TextFragmentAnchor",
+ base::FEATURE_DISABLED_BY_DEFAULT);
+
// File handling icons. https://crbug.com/1218213
BASE_FEATURE(kFileHandlingIcons,
@@ -120,7 +121,7 @@ diff --git a/third_party/blink/public/common/features.h b/third_party/blink/publ
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kDecodeLossyWebPImagesToYUV);
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kWebFontsCacheAwareTimeoutAdaption);
+BLINK_COMMON_EXPORT extern const base::Feature kTextFragmentAnchor;
+BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kTextFragmentAnchor);
BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kAudioWorkletThreadRealtimePriority);
+4 -4
View File
@@ -375,14 +375,14 @@ diff --git a/chrome/browser/flags/android/chrome_feature_list.cc b/chrome/browse
diff --git a/chrome/browser/flags/android/chrome_feature_list.h b/chrome/browser/flags/android/chrome_feature_list.h
--- a/chrome/browser/flags/android/chrome_feature_list.h
+++ b/chrome/browser/flags/android/chrome_feature_list.h
@@ -141,6 +141,7 @@ BASE_DECLARE_FEATURE(kSearchEnginePromoExistingDeviceV2);
BASE_DECLARE_FEATURE(kSearchEnginePromoNewDevice);
@@ -142,6 +142,7 @@ BASE_DECLARE_FEATURE(kSearchEnginePromoNewDevice);
BASE_DECLARE_FEATURE(kSearchEnginePromoNewDeviceV2);
BASE_DECLARE_FEATURE(kShareButtonInTopToolbar);
+extern const base::Feature kSharedIntentUI;
extern const base::Feature kSearchReadyOmniboxFeature;
BASE_DECLARE_FEATURE(kSearchReadyOmniboxFeature);
+BASE_DECLARE_FEATURE(kSharedIntentUI);
BASE_DECLARE_FEATURE(kSharingHubLinkToggle);
BASE_DECLARE_FEATURE(kShowScrollableMVTOnNTPAndroid);
BASE_DECLARE_FEATURE(kFeedPositionAndroid);
diff --git a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
--- a/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
+++ b/chrome/browser/flags/android/java/src/org/chromium/chrome/browser/flags/ChromeFeatureList.java
@@ -4,9 +4,54 @@ Subject: Guard for user-agent reduction
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
---
third_party/blink/common/features.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
chrome/browser/chrome_content_browser_client.cc | 2 +-
content/common/user_agent.cc | 13 +++++--------
third_party/blink/common/features.cc | 4 ++--
.../platform/runtime_enabled_features.json5 | 3 ++-
4 files changed, 10 insertions(+), 12 deletions(-)
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -1475,7 +1475,7 @@ void ChromeContentBrowserClient::RegisterProfilePrefs(
registry->RegisterIntegerPref(
prefs::kUserAgentReduction,
static_cast<int>(
- embedder_support::UserAgentReductionEnterprisePolicyState::kDefault));
+ embedder_support::UserAgentReductionEnterprisePolicyState::kForceEnabled));
registry->RegisterBooleanPref(prefs::kOriginAgentClusterDefaultEnabled, true);
registry->RegisterIntegerPref(
prefs::kForceMajorVersionToMinorPositionInUserAgent,
diff --git a/content/common/user_agent.cc b/content/common/user_agent.cc
--- a/content/common/user_agent.cc
+++ b/content/common/user_agent.cc
@@ -323,14 +323,7 @@ std::string BuildUserAgentFromProduct(const std::string& product) {
}
std::string BuildModelInfo() {
- std::string model;
-#if BUILDFLAG(IS_ANDROID)
- // Only send the model information if on the release build of Android,
- // matching user agent behaviour.
- if (base::SysInfo::GetAndroidBuildCodename() == "REL")
- model = base::SysInfo::HardwareModelName();
-#endif
- return model;
+ return std::string();
}
#if BUILDFLAG(IS_ANDROID)
@@ -351,6 +344,10 @@ std::string GetAndroidOSInfo(
IncludeAndroidModel include_android_model) {
std::string android_info_str;
+ // Do not send information about the device.
+ include_android_model = IncludeAndroidModel::Exclude;
+ include_android_build_number = IncludeAndroidBuildNumber::Exclude;
+
// Send information about the device.
bool semicolon_inserted = false;
if (include_android_model == IncludeAndroidModel::Include) {
diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/features.cc
--- a/third_party/blink/common/features.cc
+++ b/third_party/blink/common/features.cc
@@ -21,5 +66,18 @@ diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/fea
const base::FeatureParam<bool> kLegacyWindowsPlatform = {
&kReduceUserAgentPlatformOsCpu, "legacy_windows_platform", true};
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5
--- a/third_party/blink/renderer/platform/runtime_enabled_features.json5
+++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -2711,7 +2711,8 @@
base_feature: "UserAgentClientHint",
},
{
- name: "UserAgentReduction",
+ name: "UserAgentReduction", // always enabled
+ status: "stable", // in bromite
origin_trial_feature_name: "UserAgentReduction",
origin_trial_allows_third_party: true,
// iOS not included as it should not send a reduced User-Agent string.
--
2.25.1
File diff suppressed because it is too large Load Diff
@@ -12,9 +12,9 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
.../webauthn/authenticator_dialog_browsertest.cc | 7 +++++++
.../webauthn/chrome_webauthn_browsertest.cc | 2 ++
.../webauth/authenticator_impl_unittest.cc | 15 +++++++++++++--
content/public/common/content_features.cc | 6 ++++++
content/public/common/content_features.cc | 7 +++++++
content/public/common/content_features.h | 1 +
6 files changed, 36 insertions(+), 2 deletions(-)
6 files changed, 37 insertions(+), 2 deletions(-)
diff --git a/chrome/browser/ui/views/webauthn/authenticator_dialog_view_browsertest.cc b/chrome/browser/ui/views/webauthn/authenticator_dialog_view_browsertest.cc
--- a/chrome/browser/ui/views/webauthn/authenticator_dialog_view_browsertest.cc
@@ -118,15 +118,16 @@ diff --git a/content/browser/webauth/authenticator_impl_unittest.cc b/content/br
diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc
--- a/content/public/common/content_features.cc
+++ b/content/public/common/content_features.cc
@@ -1283,6 +1283,12 @@ BASE_FEATURE(kWebAssemblyTrapHandler,
@@ -1284,6 +1284,13 @@ BASE_FEATURE(kWebAssemblyTrapHandler,
#endif
);
+// Controls whether CTAP2 devices can communicate via the WebAuthentication API
+// using pairingless BLE protocol.
+// https://w3c.github.io/webauthn
+const base::Feature kWebAuthCable{"WebAuthenticationCable", // must be disabled
+ base::FEATURE_DISABLED_BY_DEFAULT}; // by default in Bromite
+BASE_FEATURE(kWebAuthCable,
+ "WebAuthenticationCable", // must be disabled
+ base::FEATURE_DISABLED_BY_DEFAULT); // by default in Bromite
+
// Controls whether WebAuthn conditional UI requests are supported.
BASE_FEATURE(kWebAuthConditionalUI,
@@ -138,7 +139,7 @@ diff --git a/content/public/common/content_features.h b/content/public/common/co
CONTENT_EXPORT BASE_DECLARE_FEATURE(kWebRtcUseGpuMemoryBufferVideoFrames);
CONTENT_EXPORT BASE_DECLARE_FEATURE(kWebUICodeCache);
CONTENT_EXPORT BASE_DECLARE_FEATURE(kWebUIReportOnlyTrustedTypes);
+CONTENT_EXPORT extern const base::Feature kWebAuthCable;
+CONTENT_EXPORT BASE_DECLARE_FEATURE(kWebAuthCable);
CONTENT_EXPORT BASE_DECLARE_FEATURE(kWebUsb);
CONTENT_EXPORT BASE_DECLARE_FEATURE(kWebXr);
CONTENT_EXPORT BASE_DECLARE_FEATURE(kWebXrArModule);
@@ -11,106 +11,13 @@ A preference is also introduced to completely removes referrals management, for
Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
---
chrome/android/chrome_java_resources.gni | 2 +
chrome/android/chrome_java_sources.gni | 2 +
...button_group_referer_policy_preference.xml | 47 ++++++++++
.../java/res/xml/privacy_preferences.xml | 4 +
.../res/xml/referer_policy_preferences.xml | 31 +++++++
.../privacy/settings/PrivacySettings.java | 6 ++
.../RadioButtonGroupRefererSettings.java | 89 +++++++++++++++++++
.../settings/RefererSettingsFragment.java | 79 ++++++++++++++++
.../net/system_network_context_manager.cc | 4 +
chrome/browser/renderer_preferences_util.cc | 1 +
.../strings/android_chrome_strings.grd | 24 +++++
chrome/browser/ui/prefs/pref_watcher.cc | 2 +
chrome/browser/ui/prefs/prefs_tab_helper.cc | 2 +
chrome/common/pref_names.cc | 3 +
chrome/common/pref_names.h | 1 +
.../renderer_host/navigation_request.cc | 8 ++
.../network/public/cpp/resource_request.h | 2 +-
.../renderer_preferences.h | 1 +
18 files changed, 307 insertions(+), 1 deletion(-)
create mode 100644 chrome/android/java/res/layout/radio_button_group_referer_policy_preference.xml
create mode 100644 chrome/android/java/res/xml/referer_policy_preferences.xml
create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/RadioButtonGroupRefererSettings.java
create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/RefererSettingsFragment.java
chrome/android/java/res/xml/privacy_preferences.xml | 4 ++++
.../chrome/browser/privacy/settings/PrivacySettings.java | 8 ++++++++
.../browser/ui/android/strings/android_chrome_strings.grd | 3 +++
content/browser/renderer_host/navigation_request.cc | 7 +++++++
services/network/public/cpp/resource_request.h | 2 +-
5 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/chrome/android/chrome_java_resources.gni b/chrome/android/chrome_java_resources.gni
--- a/chrome/android/chrome_java_resources.gni
+++ b/chrome/android/chrome_java_resources.gni
@@ -658,6 +658,8 @@ chrome_java_resources = [
"java/res/xml/phone_as_a_security_key_accessory_filter.xml",
"java/res/xml/incognito_preferences.xml",
"java/res/xml/privacy_preferences.xml",
+ "java/res/xml/referer_policy_preferences.xml",
+ "java/res/layout/radio_button_group_referer_policy_preference.xml",
"java/res/xml/search_widget_info.xml",
"java/res/xml/tracing_preferences.xml",
"java/res/xml/useragent_preferences.xml",
diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java_sources.gni
--- a/chrome/android/chrome_java_sources.gni
+++ b/chrome/android/chrome_java_sources.gni
@@ -923,6 +923,8 @@ chrome_java_sources = [
"java/src/org/chromium/chrome/browser/privacy/settings/PrivacyPreferencesManagerImpl.java",
"java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java",
"java/src/org/chromium/chrome/browser/privacy/settings/IncognitoSettings.java",
+ "java/src/org/chromium/chrome/browser/privacy/settings/RefererSettingsFragment.java",
+ "java/src/org/chromium/chrome/browser/privacy/settings/RadioButtonGroupRefererSettings.java",
"java/src/org/chromium/chrome/browser/provider/BaseColumns.java",
"java/src/org/chromium/chrome/browser/provider/BookmarkColumns.java",
"java/src/org/chromium/chrome/browser/provider/ChromeBrowserProviderImpl.java",
diff --git a/chrome/android/java/res/layout/radio_button_group_referer_policy_preference.xml b/chrome/android/java/res/layout/radio_button_group_referer_policy_preference.xml
new file mode 100644
--- /dev/null
+++ b/chrome/android/java/res/layout/radio_button_group_referer_policy_preference.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ 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/>.
+-->
+
+<org.chromium.components.browser_ui.widget.RadioButtonWithDescriptionLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:focusable="false">
+
+ <org.chromium.components.browser_ui.widget.RadioButtonWithDescription
+ android:id="@+id/no_cross_origin_top_frame_policy"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ app:primaryText="@string/no_cross_origin_top_frame_policy_title"
+ app:descriptionText="@string/no_cross_origin_top_frame_policy_summary" />
+
+ <org.chromium.components.browser_ui.widget.RadioButtonWithDescription
+ android:id="@+id/standard_referer_policy"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ app:primaryText="@string/standard_referer_policy_title"
+ app:descriptionText="@string/standard_referer_policy_summary" />
+
+ <org.chromium.components.browser_ui.widget.RadioButtonWithDescription
+ android:id="@+id/disable_referer_policy"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ app:primaryText="@string/disable_referer_policy_title"
+ app:descriptionText="@string/disable_referer_policy_summary" />
+
+</org.chromium.components.browser_ui.widget.RadioButtonWithDescriptionLayout>
diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml
--- a/chrome/android/java/res/xml/privacy_preferences.xml
+++ b/chrome/android/java/res/xml/privacy_preferences.xml
@@ -118,381 +25,67 @@ diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/androi
android:title="@string/close_tabs_on_exit_title"
android:summary="@string/close_tabs_on_exit_summary"
android:defaultValue="false" />
+ <Preference
+ android:key="referers_policy"
+ android:title="@string/referers_policy_title"
+ android:fragment="org.chromium.chrome.browser.privacy.settings.RefererSettingsFragment"/>
+ <org.chromium.components.browser_ui.settings.ChromeSwitchPreference
+ android:key="enable_referrers"
+ android:title="@string/enable_referrers_title"
+ android:defaultValue="false" />
<Preference
android:fragment="org.chromium.chrome.browser.privacy.settings.DoNotTrackSettings"
android:key="do_not_track"
diff --git a/chrome/android/java/res/xml/referer_policy_preferences.xml b/chrome/android/java/res/xml/referer_policy_preferences.xml
new file mode 100644
--- /dev/null
+++ b/chrome/android/java/res/xml/referer_policy_preferences.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ 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/>.
+-->
+
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto">
+
+ <org.chromium.components.browser_ui.settings.TextMessagePreference
+ android:key="summary"
+ android:summary="@string/referers_policy_summary"
+ app:allowDividerBelow="false" />
+ <org.chromium.chrome.browser.privacy.settings.RadioButtonGroupRefererSettings
+ android:key="referer_page_radio_button_group"
+ android:selectable="false"
+ app:allowDividerAbove="false"
+ app:allowDividerBelow="false" />
+</PreferenceScreen>
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
--- a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
@@ -24,6 +24,7 @@ import org.chromium.chrome.browser.flags.ChromeFeatureList;
import org.chromium.chrome.browser.incognito.reauth.IncognitoReauthSettingSwitchPreference;
import org.chromium.chrome.browser.preferences.Pref;
import org.chromium.chrome.browser.prefetch.settings.PreloadPagesSettingsFragment;
+import org.chromium.chrome.browser.privacy.settings.RefererSettingsFragment;
import org.chromium.chrome.browser.privacy.secure_dns.SecureDnsSettings;
import org.chromium.chrome.browser.privacy_sandbox.PrivacySandboxBridge;
import org.chromium.chrome.browser.privacy_sandbox.PrivacySandboxReferrer;
@@ -61,6 +62,7 @@ public class PrivacySettings
@@ -61,6 +61,7 @@ public class PrivacySettings
private static final String PREF_HTTPS_FIRST_MODE = "https_first_mode";
private static final String PREF_SECURE_DNS = "secure_dns";
private static final String PREF_DO_NOT_TRACK = "do_not_track";
+ private static final String PREF_REFERER_POLICY = "referers_policy";
+ private static final String PREF_ENABLE_REFERRERS = "enable_referrers";
private static final String PREF_CLEAR_BROWSING_DATA = "clear_browsing_data";
private static final String PREF_PRIVACY_GUIDE = "privacy_guide";
private static final String PREF_INCOGNITO_LOCK = "incognito_lock";
@@ -227,6 +229,10 @@ public class PrivacySettings
@@ -174,6 +175,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_ENABLE_REFERRERS.equals(key)) {
+ UserPrefs.get(Profile.getLastUsedRegularProfile())
+ .setBoolean(Pref.ENABLE_REFERRERS, (boolean) newValue);
} else if (PREF_HTTPS_FIRST_MODE.equals(key)) {
UserPrefs.get(Profile.getLastUsedRegularProfile())
.setBoolean(Pref.HTTPS_ONLY_MODE_ENABLED, (boolean) newValue);
@@ -227,6 +231,10 @@ public class PrivacySettings
: R.string.text_off);
}
+ Preference refererPolicyPref = findPreference(PREF_REFERER_POLICY);
+ refererPolicyPref.setSummary(
+ RefererSettingsFragment.getRefererSummaryString(getContext()));
+ ChromeSwitchPreference enableReferrerPref = findPreference(PREF_ENABLE_REFERRERS);
+ enableReferrerPref.setChecked(prefService.getBoolean(Pref.ENABLE_REFERRERS));
+ enableReferrerPref.setOnPreferenceChangeListener(this);
+
Preference preloadPagesPreference = findPreference(PREF_PRELOAD_PAGES);
if (preloadPagesPreference != null) {
preloadPagesPreference.setSummary(
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/RadioButtonGroupRefererSettings.java b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/RadioButtonGroupRefererSettings.java
new file mode 100644
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/RadioButtonGroupRefererSettings.java
@@ -0,0 +1,89 @@
+/*
+ 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.privacy.settings;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.view.View;
+import android.widget.RadioGroup;
+
+import androidx.preference.Preference;
+import androidx.preference.PreferenceViewHolder;
+
+import org.chromium.chrome.R;
+import org.chromium.chrome.browser.flags.ChromeFeatureList;
+import org.chromium.components.browser_ui.widget.RadioButtonWithDescription;
+import org.chromium.components.browser_ui.widget.RadioButtonWithDescriptionLayout;
+
+public class RadioButtonGroupRefererSettings extends Preference
+ implements RadioGroup.OnCheckedChangeListener {
+
+ private RadioButtonWithDescription mStandardReferer;
+ private RadioButtonWithDescription mNoCrossOriginReferer;
+ private RadioButtonWithDescription mNoReferer;
+ private int mRefererPolicy;
+
+ public RadioButtonGroupRefererSettings(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ setLayoutResource(R.layout.radio_button_group_referer_policy_preference);
+ }
+
+ public void init(boolean enableReferer, int refererPolicy) {
+ if (!enableReferer)
+ mRefererPolicy = 0;
+ else
+ mRefererPolicy = refererPolicy;
+ }
+
+ @Override
+ public void onCheckedChanged(RadioGroup group, int checkedId) {
+ if (checkedId == mStandardReferer.getId()) {
+ mRefererPolicy = 1;
+ } else if (checkedId == mNoCrossOriginReferer.getId()) {
+ mRefererPolicy = 2;
+ } else if (checkedId == mNoReferer.getId()) {
+ mRefererPolicy = 0;
+ } else {
+ assert false : "Should not be reached.";
+ }
+ callChangeListener(mRefererPolicy);
+ }
+
+ @Override
+ public void onBindViewHolder(PreferenceViewHolder holder) {
+ super.onBindViewHolder(holder);
+
+ mStandardReferer = (RadioButtonWithDescription) holder.findViewById(
+ R.id.standard_referer_policy);
+ mNoCrossOriginReferer = (RadioButtonWithDescription) holder.findViewById(
+ R.id.no_cross_origin_top_frame_policy);
+ mNoReferer = (RadioButtonWithDescription) holder.findViewById(R.id.disable_referer_policy);
+
+ RadioButtonWithDescriptionLayout groupLayout =
+ (RadioButtonWithDescriptionLayout) mNoReferer.getRootView();
+ setCheckedState(mRefererPolicy);
+ groupLayout.setOnCheckedChangeListener(this);
+ }
+
+ public void setCheckedState(int checkedState) {
+ mRefererPolicy = checkedState;
+ mStandardReferer.setChecked(checkedState == 1);
+ mNoCrossOriginReferer.setChecked(checkedState == 2);
+ mNoReferer.setChecked(checkedState == 0);
+ }
+}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/RefererSettingsFragment.java b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/RefererSettingsFragment.java
new file mode 100644
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/RefererSettingsFragment.java
@@ -0,0 +1,79 @@
+/*
+ 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.privacy.settings;
+
+import android.os.Bundle;
+import android.content.Context;
+
+import androidx.preference.Preference;
+import androidx.preference.PreferenceFragmentCompat;
+
+import org.chromium.chrome.R;
+import org.chromium.chrome.browser.preferences.Pref;
+import org.chromium.chrome.browser.profiles.Profile;
+import org.chromium.components.browser_ui.settings.TextMessagePreference;
+import org.chromium.components.browser_ui.settings.SettingsUtils;
+import org.chromium.components.prefs.PrefService;
+import org.chromium.components.user_prefs.UserPrefs;
+
+public class RefererSettingsFragment
+ extends PreferenceFragmentCompat
+ implements Preference.OnPreferenceChangeListener {
+
+ static final String PREF_REFERER_POLICY = "referer_page_radio_button_group";
+
+ private RadioButtonGroupRefererSettings mRefererPreference;
+ private final PrefService prefService = UserPrefs.get(Profile.getLastUsedRegularProfile());
+
+ public static String getRefererSummaryString(Context context) {
+ int policy = UserPrefs.get(Profile.getLastUsedRegularProfile())
+ .getInteger(Pref.REFERRERS_POLICY);
+
+ if (policy == 0) {
+ return context.getString(R.string.disable_referer_policy_title);
+ }
+ if (policy == 1) {
+ return context.getString(R.string.standard_referer_policy_title);
+ }
+ if (policy == 2) {
+ return context.getString(R.string.no_cross_origin_top_frame_policy_title);
+ }
+ assert false : "Should not be reached";
+ return "";
+ }
+
+ @Override
+ public void onCreatePreferences(Bundle bundle, String s) {
+ SettingsUtils.addPreferencesFromResource(this, R.xml.referer_policy_preferences);
+ getActivity().setTitle(R.string.referers_policy_title);
+
+ mRefererPreference = findPreference(PREF_REFERER_POLICY);
+ mRefererPreference.init(prefService.getBoolean(Pref.ENABLE_REFERRERS),
+ prefService.getInteger(Pref.REFERRERS_POLICY));
+ mRefererPreference.setOnPreferenceChangeListener(this);
+ }
+
+ @Override
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
+ UserPrefs.get(Profile.getLastUsedRegularProfile())
+ .setInteger(Pref.REFERRERS_POLICY, (int)newValue);
+ UserPrefs.get(Profile.getLastUsedRegularProfile())
+ .setBoolean(Pref.ENABLE_REFERRERS, (int)newValue != 0);
+ return true;
+ }
+}
diff --git a/chrome/browser/net/system_network_context_manager.cc b/chrome/browser/net/system_network_context_manager.cc
--- a/chrome/browser/net/system_network_context_manager.cc
+++ b/chrome/browser/net/system_network_context_manager.cc
@@ -479,6 +479,9 @@ SystemNetworkContextManager::SystemNetworkContextManager(
base::BindRepeating(&SystemNetworkContextManager::UpdateReferrersEnabled,
base::Unretained(this)));
+ local_state_->SetDefaultPrefValue(
+ prefs::kReferrersPolicy, base::Value(2));
+
pref_change_registrar_.Add(
prefs::kExplicitlyAllowedNetworkPorts,
base::BindRepeating(
@@ -545,6 +548,7 @@ void SystemNetworkContextManager::RegisterPrefs(PrefRegistrySimple* registry) {
// the system NetworkContext, and the per-profile pref values are used for
// the profile NetworkContexts.
registry->RegisterBooleanPref(prefs::kEnableReferrers, true);
+ registry->RegisterIntegerPref(prefs::kReferrersPolicy, 2);
registry->RegisterBooleanPref(prefs::kQuickCheckEnabled, true);
diff --git a/chrome/browser/renderer_preferences_util.cc b/chrome/browser/renderer_preferences_util.cc
--- a/chrome/browser/renderer_preferences_util.cc
+++ b/chrome/browser/renderer_preferences_util.cc
@@ -115,6 +115,7 @@ void UpdateFromSystemSettings(blink::RendererPreferences* prefs,
prefs->accept_languages = GetLanguageListForProfile(
profile, pref_service->GetString(language::prefs::kAcceptLanguages));
prefs->enable_referrers = pref_service->GetBoolean(prefs::kEnableReferrers);
+ prefs->referrers_policy = pref_service->GetInteger(prefs::kReferrersPolicy);
prefs->enable_do_not_track =
pref_service->GetBoolean(prefs::kEnableDoNotTrack);
prefs->enable_encrypted_media =
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
--- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
+++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
@@ -879,6 +879,30 @@ CHAR_LIMIT guidelines:
@@ -879,6 +879,9 @@ CHAR_LIMIT guidelines:
For example, some websites may respond to this request by showing you ads that arent based on other websites youve visited. Many websites will still collect and use your browsing data — for example to improve security, to provide content, ads and recommendations, and to generate reporting statistics.
</message>
+ <message name="IDS_REFERERS_POLICY_TITLE" desc="Title for 'Enable referers' preference">
+ HTTP Referer header policy
+ </message>
+ <message name="IDS_REFERERS_POLICY_SUMMARY" desc="Summary for a section in Settings that controls referer policy.">
+ Allow to change default HTTP Referer header policy
+ </message>
+ <message name="IDS_STANDARD_REFERER_POLICY_TITLE" desc="Title for 'standard referer' preference">
+ Standard HTTP Referrer header policy
+ </message>
+ <message name="IDS_STANDARD_REFERER_POLICY_SUMMARY" desc="Summary for 'standard referer' preference">
+ Send only origin if the request is cross-origin
+ </message>
+ <message name="IDS_NO_CROSS_ORIGIN_TOP_FRAME_POLICY_TITLE" desc="Title for 'standard referer' preference">
+ Disable if cross-origin and user begins navigation
+ </message>
+ <message name="IDS_NO_CROSS_ORIGIN_TOP_FRAME_POLICY_SUMMARY" desc="Summary for 'no cross origin referer' preference">
+ Remove referrer if the navigation is cross-origin and occurs in the top frame otherwise send only origin if the request is cross-origin
+ </message>
+ <message name="IDS_DISABLE_REFERER_POLICY_TITLE" desc="Title for 'disable referer' preference">
+ Disable all referrers
+ </message>
+ <message name="IDS_DISABLE_REFERER_POLICY_SUMMARY" desc="Summary for 'disable referer' preference">
+ Disable all referrers, may break navigation
+ <message name="IDS_ENABLE_REFERRERS_TITLE" desc="Title for 'Enable referrers' preference">
+ Enable HTTP Referer header
+ </message>
<message name="IDS_CAN_MAKE_PAYMENT_TITLE" desc="Title for preference to allow websites to know whether you have payment methods available through PaymentRequest.CanMakePayment interface">
Access payment methods
</message>
diff --git a/chrome/browser/ui/prefs/pref_watcher.cc b/chrome/browser/ui/prefs/pref_watcher.cc
--- a/chrome/browser/ui/prefs/pref_watcher.cc
+++ b/chrome/browser/ui/prefs/pref_watcher.cc
@@ -84,6 +84,8 @@ PrefWatcher::PrefWatcher(Profile* profile) : profile_(profile) {
renderer_callback);
profile_pref_change_registrar_.Add(prefs::kEnableReferrers,
renderer_callback);
+ profile_pref_change_registrar_.Add(prefs::kReferrersPolicy,
+ renderer_callback);
profile_pref_change_registrar_.Add(prefs::kEnableEncryptedMedia,
renderer_callback);
profile_pref_change_registrar_.Add(prefs::kWebRTCIPHandlingPolicy,
diff --git a/chrome/browser/ui/prefs/prefs_tab_helper.cc b/chrome/browser/ui/prefs/prefs_tab_helper.cc
--- a/chrome/browser/ui/prefs/prefs_tab_helper.cc
+++ b/chrome/browser/ui/prefs/prefs_tab_helper.cc
@@ -360,6 +360,8 @@ void PrefsTabHelper::RegisterProfilePrefs(
registry->RegisterBooleanPref(
prefs::kEnableReferrers,
!base::FeatureList::IsEnabled(features::kNoReferrers));
+ registry->RegisterIntegerPref(
+ prefs::kReferrersPolicy, 2); // NoCrossOriginReferer
registry->RegisterBooleanPref(prefs::kEnableEncryptedMedia, true);
registry->RegisterBooleanPref(prefs::kScrollToTextFragmentEnabled, false);
#if BUILDFLAG(IS_ANDROID)
diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc
--- a/chrome/common/pref_names.cc
+++ b/chrome/common/pref_names.cc
@@ -1432,6 +1432,9 @@ const char kEnableHyperlinkAuditing[] = "enable_a_ping";
// Whether to enable sending referrers.
const char kEnableReferrers[] = "enable_referrers";
+// Set referrer policy.
+const char kReferrersPolicy[] = "referrers_policy";
+
// Whether to send the DNT header.
const char kEnableDoNotTrack[] = "enable_do_not_track";
diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h
--- a/chrome/common/pref_names.h
+++ b/chrome/common/pref_names.h
@@ -442,6 +442,7 @@ extern const char kPinnedTabs[];
extern const char kDisable3DAPIs[];
extern const char kEnableHyperlinkAuditing[];
extern const char kEnableReferrers[];
+extern const char kReferrersPolicy[];
extern const char kEnableDoNotTrack[];
extern const char kEnableEncryptedMedia[];
diff --git a/content/browser/renderer_host/navigation_request.cc b/content/browser/renderer_host/navigation_request.cc
--- a/content/browser/renderer_host/navigation_request.cc
+++ b/content/browser/renderer_host/navigation_request.cc
@@ -431,6 +431,14 @@ void AddAdditionalRequestHeaders(
@@ -431,6 +431,13 @@ void AddAdditionalRequestHeaders(
blink::mojom::Referrer(GURL(), network::mojom::ReferrerPolicy::kNever);
}
+ if (render_prefs.enable_referrers && render_prefs.referrers_policy == 2 &&
+ !url::IsSameOriginWith(referrer->url.GetAsReferrer(), url) &&
+ frame_tree_node->IsOutermostMainFrame()) {
+ if (!url::IsSameOriginWith(referrer->url.GetAsReferrer(), url) &&
+ frame_tree_node->IsOutermostMainFrame()) {
+ // remove referrer if the navigation is done on the top frame
+ *referrer =
+ blink::mojom::Referrer(GURL(), network::mojom::ReferrerPolicy::kNever);
@@ -513,16 +106,5 @@ diff --git a/services/network/public/cpp/resource_request.h b/services/network/p
net::HttpRequestHeaders headers;
net::HttpRequestHeaders cors_exempt_headers;
int load_flags = 0;
diff --git a/third_party/blink/public/common/renderer_preferences/renderer_preferences.h b/third_party/blink/public/common/renderer_preferences/renderer_preferences.h
--- a/third_party/blink/public/common/renderer_preferences/renderer_preferences.h
+++ b/third_party/blink/public/common/renderer_preferences/renderer_preferences.h
@@ -40,6 +40,7 @@ struct BLINK_COMMON_EXPORT RendererPreferences {
absl::optional<base::TimeDelta> caret_blink_interval;
bool use_custom_colors{true};
bool enable_referrers{true};
+ uint32_t referrers_policy{2};
bool allow_cross_origin_auth_prompt{false};
bool enable_do_not_track{false};
bool enable_encrypted_media{true};
--
2.25.1
@@ -7,9 +7,9 @@ Also fixes a crash on startup.
Original License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
---
.../chrome_browser_main_extra_parts_segmentation_platform.cc | 4 ++++
components/segmentation_platform/public/features.cc | 4 ----
2 files changed, 4 insertions(+), 4 deletions(-)
...rome_browser_main_extra_parts_segmentation_platform.cc | 4 ++++
components/segmentation_platform/public/features.cc | 8 ++------
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/chrome/browser/segmentation_platform/chrome_browser_main_extra_parts_segmentation_platform.cc b/chrome/browser/segmentation_platform/chrome_browser_main_extra_parts_segmentation_platform.cc
--- a/chrome/browser/segmentation_platform/chrome_browser_main_extra_parts_segmentation_platform.cc
@@ -45,6 +45,17 @@ diff --git a/chrome/browser/segmentation_platform/chrome_browser_main_extra_part
diff --git a/components/segmentation_platform/public/features.cc b/components/segmentation_platform/public/features.cc
--- a/components/segmentation_platform/public/features.cc
+++ b/components/segmentation_platform/public/features.cc
@@ -9,8 +9,8 @@
namespace segmentation_platform::features {
BASE_FEATURE(kSegmentationPlatformFeature,
- "SegmentationPlatform",
- base::FEATURE_ENABLED_BY_DEFAULT);
+ "SegmentationPlatform", // disabled by default
+ base::FEATURE_DISABLED_BY_DEFAULT); // in Bromite
BASE_FEATURE(kSegmentationStructuredMetricsFeature,
"SegmentationStructuredMetrics",
@@ -34,11 +34,7 @@ BASE_FEATURE(kSegmentationPlatformSearchUser,
BASE_FEATURE(kSegmentationPlatformFeedSegmentFeature,
@@ -104,7 +104,7 @@ diff --git a/chrome/browser/flags/android/chrome_feature_list.h b/chrome/browser
BASE_DECLARE_FEATURE(kSearchEnginePromoNewDevice);
BASE_DECLARE_FEATURE(kSearchEnginePromoNewDeviceV2);
BASE_DECLARE_FEATURE(kShareButtonInTopToolbar);
+extern const base::Feature kSearchReadyOmniboxFeature;
+BASE_DECLARE_FEATURE(kSearchReadyOmniboxFeature);
BASE_DECLARE_FEATURE(kSharingHubLinkToggle);
BASE_DECLARE_FEATURE(kShowScrollableMVTOnNTPAndroid);
BASE_DECLARE_FEATURE(kFeedPositionAndroid);
@@ -209,7 +209,7 @@ diff --git a/chrome/browser/flags/android/chrome_feature_list.h b/chrome/browser
BASE_DECLARE_FEATURE(kLensOnQuickActionSearchWidget);
BASE_DECLARE_FEATURE(kLocationBarModelOptimizations);
BASE_DECLARE_FEATURE(kNewInstanceFromDraggedLink);
+extern const base::Feature kOfflineIndicatorV2;
+BASE_DECLARE_FEATURE(kOfflineIndicatorV2);
BASE_DECLARE_FEATURE(kNewTabPageTilesTitleWrapAround);
BASE_DECLARE_FEATURE(kNewWindowAppMenu);
BASE_DECLARE_FEATURE(kNotificationPermissionVariant);