1895 lines
80 KiB
Diff
1895 lines
80 KiB
Diff
From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
|
Date: Mon, 12 Feb 2018 21:36:33 +0100
|
|
Subject: ungoogled-chromium: no special hosts/domains
|
|
|
|
Disables various detections of Google hosts and functionality specific to them
|
|
Disable domain reliability detection
|
|
|
|
License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
|
|
---
|
|
.../chrome/browser/ui/RootUiCoordinator.java | 3 -
|
|
chrome/browser/BUILD.gn | 14 -
|
|
.../android/metrics/uma_session_stats.cc | 10 -
|
|
chrome/browser/browser_process_impl.cc | 1 -
|
|
chrome/browser/chrome_browser_main.cc | 10 -
|
|
.../browser/chrome_content_browser_client.cc | 32 +-
|
|
.../domain_reliability/service_factory.cc | 33 +-
|
|
chrome/browser/extensions/BUILD.gn | 1 -
|
|
chrome/browser/feedback/BUILD.gn | 1 -
|
|
.../log_sources/chrome_internal_log_source.cc | 5 -
|
|
chrome/browser/first_run/first_run.cc | 8 -
|
|
chrome/browser/google/BUILD.gn | 4 +-
|
|
.../long_screenshots_tab_service.cc | 22 --
|
|
.../metrics/chrome_metrics_service_client.cc | 2 +-
|
|
.../chrome_metrics_services_manager_client.cc | 5 +-
|
|
.../metrics/metrics_reporting_state.cc | 72 +---
|
|
.../net/system_network_context_manager.cc | 1 -
|
|
.../one_google_bar_loader_impl.cc | 3 +-
|
|
.../new_tab_page/promos/promo_service.cc | 6 +-
|
|
.../from_gws_page_load_metrics_observer.cc | 2 -
|
|
.../page_load_metrics_initialize.cc | 5 -
|
|
chrome/browser/profile_resetter/BUILD.gn | 1 -
|
|
.../profile_resetter/profile_resetter.cc | 3 +-
|
|
chrome/browser/safe_browsing/BUILD.gn | 1 -
|
|
chrome/browser/search_engines/BUILD.gn | 1 -
|
|
.../ui_thread_search_terms_data.cc | 4 -
|
|
.../signin/android/signin_manager_android.cc | 5 +-
|
|
chrome/browser/ui/BUILD.gn | 1 -
|
|
chrome/browser/ui/android/omnibox/BUILD.gn | 2 -
|
|
.../omnibox/LocationBarCoordinator.java | 2 -
|
|
.../browser/omnibox/LocationBarMediator.java | 25 --
|
|
.../ui/webui/new_tab_page/new_tab_page_ui.cc | 6 -
|
|
.../upgrade_detector/upgrade_detector_impl.cc | 6 -
|
|
chrome/common/BUILD.gn | 2 -
|
|
.../google_accounts_private_api_util.cc | 3 +
|
|
.../url_loader_throttle_provider_impl.cc | 11 -
|
|
chrome/test/BUILD.gn | 1 -
|
|
components/domain_reliability/BUILD.gn | 5 +-
|
|
.../domain_reliability/bake_in_configs.py | 2 +-
|
|
.../domain_reliability/context_manager.cc | 22 +-
|
|
.../domain_reliability/google_configs.cc | 73 +---
|
|
.../domain_reliability/google_configs.h | 8 +-
|
|
components/domain_reliability/monitor.cc | 8 -
|
|
components/domain_reliability/uploader.cc | 2 +-
|
|
components/google/core/common/google_util.cc | 327 +-----------------
|
|
components/google/core/common/google_util.h | 15 +-
|
|
.../browser/page_load_metrics_util.cc | 3 +-
|
|
.../google/browser/google_url_util.cc | 1 +
|
|
.../search_engines/search_engine_utils.cc | 1 +
|
|
.../search_engines/search_terms_data.cc | 4 +-
|
|
components/search_engines/template_url.cc | 6 +-
|
|
components/search_provider_logos/BUILD.gn | 2 -
|
|
.../logo_service_impl.cc | 16 +-
|
|
components/url_matcher/url_util.cc | 89 -----
|
|
.../webid/identity_url_loader_throttle.cc | 1 +
|
|
...gled-chromium-no-special-hosts-domains.inc | 1 +
|
|
net/base/url_util.cc | 25 +-
|
|
services/network/network_context.cc | 2 +-
|
|
58 files changed, 52 insertions(+), 875 deletions(-)
|
|
create mode 100644 cromite_flags/content/public/common/content_features_cc/ungoogled-chromium-no-special-hosts-domains.inc
|
|
|
|
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java
|
|
--- a/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java
|
|
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java
|
|
@@ -95,7 +95,6 @@ import org.chromium.chrome.browser.messages.MessageContainerObserver;
|
|
import org.chromium.chrome.browser.messages.MessagesResourceMapperInitializer;
|
|
import org.chromium.chrome.browser.metrics.UmaSessionStats;
|
|
import org.chromium.chrome.browser.omnibox.OmniboxFocusReason;
|
|
-import org.chromium.chrome.browser.omnibox.geo.GeolocationHeader;
|
|
import org.chromium.chrome.browser.omnibox.suggestions.action.OmniboxActionDelegateImpl;
|
|
import org.chromium.chrome.browser.paint_preview.DemoPaintPreview;
|
|
import org.chromium.chrome.browser.password_manager.ManagePasswordsReferrer;
|
|
@@ -1154,10 +1153,8 @@ public class RootUiCoordinator
|
|
String url =
|
|
TemplateUrlServiceFactory.getForProfile(tab.getProfile())
|
|
.getUrlForSearchQuery(query);
|
|
- String headers = GeolocationHeader.getGeoHeader(url, tab);
|
|
|
|
LoadUrlParams loadUrlParams = new LoadUrlParams(url);
|
|
- loadUrlParams.setVerbatimHeaders(headers);
|
|
loadUrlParams.setTransitionType(PageTransition.GENERATED);
|
|
return loadUrlParams;
|
|
}
|
|
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
|
|
--- a/chrome/browser/BUILD.gn
|
|
+++ b/chrome/browser/BUILD.gn
|
|
@@ -908,10 +908,6 @@ static_library("browser") {
|
|
"page_info/privacy_policy_insights_service_factory.h",
|
|
"page_load_metrics/observers/bookmark_bar_page_load_metrics_observer.cc",
|
|
"page_load_metrics/observers/bookmark_bar_page_load_metrics_observer.h",
|
|
- "page_load_metrics/observers/chrome_gws_abandoned_page_load_metrics_observer.cc",
|
|
- "page_load_metrics/observers/chrome_gws_abandoned_page_load_metrics_observer.h",
|
|
- "page_load_metrics/observers/chrome_gws_page_load_metrics_observer.cc",
|
|
- "page_load_metrics/observers/chrome_gws_page_load_metrics_observer.h",
|
|
"page_load_metrics/observers/core/amp_page_load_metrics_observer.cc",
|
|
"page_load_metrics/observers/core/amp_page_load_metrics_observer.h",
|
|
"page_load_metrics/observers/core/ukm_page_load_metrics_observer.cc",
|
|
@@ -920,10 +916,6 @@ static_library("browser") {
|
|
"page_load_metrics/observers/document_write_page_load_metrics_observer.h",
|
|
"page_load_metrics/observers/foreground_duration_ukm_observer.cc",
|
|
"page_load_metrics/observers/foreground_duration_ukm_observer.h",
|
|
- "page_load_metrics/observers/from_gws_page_load_metrics_observer.cc",
|
|
- "page_load_metrics/observers/from_gws_page_load_metrics_observer.h",
|
|
- "page_load_metrics/observers/gws_hp_page_load_metrics_observer.cc",
|
|
- "page_load_metrics/observers/gws_hp_page_load_metrics_observer.h",
|
|
"page_load_metrics/observers/histogram_suffixes.cc",
|
|
"page_load_metrics/observers/histogram_suffixes.h",
|
|
"page_load_metrics/observers/https_engagement_metrics/https_engagement_page_load_metrics_observer.cc",
|
|
@@ -1579,8 +1571,6 @@ static_library("browser") {
|
|
"supervised_user/classify_url_navigation_throttle.h",
|
|
"supervised_user/supervised_user_browser_utils.cc",
|
|
"supervised_user/supervised_user_browser_utils.h",
|
|
- "supervised_user/supervised_user_google_auth_navigation_throttle.cc",
|
|
- "supervised_user/supervised_user_google_auth_navigation_throttle.h",
|
|
"supervised_user/supervised_user_interstitial_tab_closer.cc",
|
|
"supervised_user/supervised_user_interstitial_tab_closer.h",
|
|
"supervised_user/supervised_user_metrics_service_factory.cc",
|
|
@@ -1769,10 +1759,7 @@ static_library("browser") {
|
|
"//chrome/browser/content_settings:impl",
|
|
"//chrome/browser/devtools",
|
|
"//chrome/browser/favicon",
|
|
- "//chrome/browser/feedback",
|
|
- "//chrome/browser/feedback:feedback_impl",
|
|
"//chrome/browser/file_system_access:impl",
|
|
- "//chrome/browser/google",
|
|
"//chrome/browser/ip_protection",
|
|
"//chrome/browser/media/webrtc",
|
|
"//chrome/browser/navigation_predictor:impl",
|
|
@@ -1855,7 +1842,6 @@ static_library("browser") {
|
|
# New dependencies inside of //chrome/browser that generate header files
|
|
# should be added to browser_generated_files.
|
|
":browser_public_dependencies",
|
|
- "//chrome/browser/google",
|
|
"//chrome/browser/headless",
|
|
"//chrome/browser/profiles",
|
|
"//chrome/browser/ui/tabs:tab_enums",
|
|
diff --git a/chrome/browser/android/metrics/uma_session_stats.cc b/chrome/browser/android/metrics/uma_session_stats.cc
|
|
--- a/chrome/browser/android/metrics/uma_session_stats.cc
|
|
+++ b/chrome/browser/android/metrics/uma_session_stats.cc
|
|
@@ -259,16 +259,6 @@ static void JNI_UmaSessionStats_ChangeMetricsReportingConsent(
|
|
jint called_from) {
|
|
UpdateMetricsPrefsOnPermissionChange(
|
|
consent, static_cast<ChangeMetricsReportingStateCalledFrom>(called_from));
|
|
-
|
|
- // This function ensures a consent file in the data directory is either
|
|
- // created, or deleted, depending on consent. Starting up metrics services
|
|
- // will ensure that the consent file contains the ClientID. The ID is passed
|
|
- // to the renderer for crash reporting when things go wrong.
|
|
- GoogleUpdateSettings::CollectStatsConsentTaskRunner()->PostTask(
|
|
- FROM_HERE,
|
|
- base::BindOnce(
|
|
- base::IgnoreResult(GoogleUpdateSettings::SetCollectStatsConsent),
|
|
- consent));
|
|
}
|
|
|
|
// Initialize the local consent bool variable to false. Used only for testing.
|
|
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
|
|
--- a/chrome/browser/browser_process_impl.cc
|
|
+++ b/chrome/browser/browser_process_impl.cc
|
|
@@ -1239,7 +1239,6 @@ BrowserProcessImpl::component_updater() {
|
|
std::make_unique<component_updater::TimerUpdateScheduler>();
|
|
|
|
std::string brand;
|
|
- google_brand::GetBrand(&brand);
|
|
component_updater_ = component_updater::ComponentUpdateServiceFactory(
|
|
component_updater::MakeChromeComponentUpdaterConfigurator(
|
|
base::CommandLine::ForCurrentProcess(),
|
|
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
|
|
--- a/chrome/browser/chrome_browser_main.cc
|
|
+++ b/chrome/browser/chrome_browser_main.cc
|
|
@@ -462,11 +462,6 @@ void ProcessSingletonNotificationCallbackImpl(
|
|
|
|
StartupBrowserCreator::ProcessCommandLineAlreadyRunning(
|
|
command_line, current_directory, startup_profile_path_info);
|
|
-
|
|
- // Record now as the last successful chrome start.
|
|
- if constexpr (kShouldRecordActiveUse) {
|
|
- GoogleUpdateSettings::SetLastRunTime();
|
|
- }
|
|
}
|
|
#endif // BUILDFLAG(ENABLE_PROCESS_SINGLETON)
|
|
|
|
@@ -1717,11 +1712,6 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
|
|
upgrade_util::SaveLastModifiedTimeOfExe();
|
|
#endif
|
|
|
|
- // Record now as the last successful chrome start.
|
|
- if constexpr (kShouldRecordActiveUse) {
|
|
- GoogleUpdateSettings::SetLastRunTime();
|
|
- }
|
|
-
|
|
// Create the RunLoop for MainMessageLoopRun() to use and transfer
|
|
// ownership of the browser's lifetime to the BrowserProcess.
|
|
DCHECK(!GetMainRunLoopInstance());
|
|
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
|
|
@@ -2990,7 +2990,6 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches(
|
|
switches::kForcePNaClSubzero,
|
|
#endif
|
|
switches::kForceUIDirection,
|
|
- switches::kIgnoreGooglePortNumbers,
|
|
switches::kJavaScriptHarmony,
|
|
switches::kEnableExperimentalWebAssemblyFeatures,
|
|
embedder_support::kOriginTrialDisabledFeatures,
|
|
@@ -5420,9 +5419,6 @@ ChromeContentBrowserClient::CreateThrottlesForNavigation(
|
|
&throttles);
|
|
#endif
|
|
|
|
- MaybeAddThrottle(
|
|
- SupervisedUserGoogleAuthNavigationThrottle::MaybeCreate(handle),
|
|
- &throttles);
|
|
|
|
MaybeAddThrottle(
|
|
supervised_user::MaybeCreateClassifyUrlNavigationThrottleFor(handle),
|
|
@@ -6041,7 +6037,8 @@ GetClientDataHeader(content::FrameTreeNodeId frame_tree_node_id) {
|
|
}
|
|
#endif
|
|
|
|
-std::unique_ptr<blink::URLLoaderThrottle> CreateGoogleURLLoaderThrottle(
|
|
+
|
|
+#if 0 // std::unique_ptr<blink::URLLoaderThrottle> CreateGoogleURLLoaderThrottle(
|
|
#if BUILDFLAG(IS_ANDROID)
|
|
const std::string& client_data_header,
|
|
#endif
|
|
@@ -6081,7 +6078,7 @@ std::unique_ptr<blink::URLLoaderThrottle> CreateGoogleURLLoaderThrottle(
|
|
std::move(bound_session_request_throttled_handler),
|
|
#endif
|
|
std::move(dynamic_params));
|
|
-}
|
|
+#endif // }
|
|
|
|
std::vector<std::unique_ptr<blink::URLLoaderThrottle>>
|
|
ChromeContentBrowserClient::CreateURLLoaderThrottles(
|
|
@@ -6138,15 +6135,6 @@ ChromeContentBrowserClient::CreateURLLoaderThrottles(
|
|
GetClientDataHeader(frame_tree_node_id);
|
|
#endif
|
|
|
|
- if (auto google_throttle = CreateGoogleURLLoaderThrottle(
|
|
-#if BUILDFLAG(IS_ANDROID)
|
|
- client_data_header,
|
|
-#endif
|
|
- profile);
|
|
- google_throttle) {
|
|
- result.push_back(std::move(google_throttle));
|
|
- }
|
|
-
|
|
{
|
|
auto* factory =
|
|
ProtocolHandlerRegistryFactory::GetForBrowserContext(browser_context);
|
|
@@ -6201,20 +6189,6 @@ ChromeContentBrowserClient::CreateURLLoaderThrottlesForKeepAlive(
|
|
}
|
|
#endif
|
|
|
|
-#if BUILDFLAG(IS_ANDROID)
|
|
- auto [client_data_header, unused_is_custom_tab] =
|
|
- GetClientDataHeader(frame_tree_node_id);
|
|
-#endif
|
|
-
|
|
- if (auto google_throttle = CreateGoogleURLLoaderThrottle(
|
|
-#if BUILDFLAG(IS_ANDROID)
|
|
- client_data_header,
|
|
-#endif
|
|
- profile);
|
|
- google_throttle) {
|
|
- result.push_back(std::move(google_throttle));
|
|
- }
|
|
-
|
|
return result;
|
|
}
|
|
|
|
diff --git a/chrome/browser/domain_reliability/service_factory.cc b/chrome/browser/domain_reliability/service_factory.cc
|
|
--- a/chrome/browser/domain_reliability/service_factory.cc
|
|
+++ b/chrome/browser/domain_reliability/service_factory.cc
|
|
@@ -14,40 +14,11 @@
|
|
|
|
namespace domain_reliability {
|
|
|
|
-namespace {
|
|
-
|
|
-// If Domain Reliability is enabled in the absence of a flag or field trial.
|
|
-const bool kDefaultEnabled = true;
|
|
-
|
|
-// The name and value of the field trial to turn Domain Reliability on.
|
|
-const char kFieldTrialName[] = "DomRel-Enable";
|
|
-const char kFieldTrialValueEnable[] = "enable";
|
|
-
|
|
-bool IsDomainReliabilityAllowed() {
|
|
- return g_browser_process->local_state()->GetBoolean(
|
|
- prefs::kDomainReliabilityAllowedByPolicy);
|
|
-}
|
|
-
|
|
-} // namespace
|
|
-
|
|
+// Identifies Chrome as the source of Domain Reliability uploads it sends.
|
|
const char kUploadReporterString[] = "chrome";
|
|
|
|
bool ShouldCreateService() {
|
|
- base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
|
|
- if (command_line->HasSwitch(switches::kDisableDomainReliability))
|
|
- return false;
|
|
- if (command_line->HasSwitch(switches::kEnableDomainReliability))
|
|
- return true;
|
|
- if (!IsDomainReliabilityAllowed()) {
|
|
- return false;
|
|
- }
|
|
- if (!ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled())
|
|
- return false;
|
|
- if (base::FieldTrialList::TrialExists(kFieldTrialName)) {
|
|
- std::string value = base::FieldTrialList::FindFullName(kFieldTrialName);
|
|
- return (value == kFieldTrialValueEnable);
|
|
- }
|
|
- return kDefaultEnabled;
|
|
+ return false;
|
|
}
|
|
|
|
} // namespace domain_reliability
|
|
diff --git a/chrome/browser/extensions/BUILD.gn b/chrome/browser/extensions/BUILD.gn
|
|
--- a/chrome/browser/extensions/BUILD.gn
|
|
+++ b/chrome/browser/extensions/BUILD.gn
|
|
@@ -313,7 +313,6 @@ source_set("extensions") {
|
|
"//chrome/browser/extensions:cws_item_service_proto",
|
|
"//chrome/browser/extensions/api:api_registration",
|
|
"//chrome/browser/favicon",
|
|
- "//chrome/browser/google",
|
|
"//chrome/browser/prefetch",
|
|
"//chrome/browser/prefs",
|
|
"//chrome/browser/preloading:prefs",
|
|
diff --git a/chrome/browser/feedback/BUILD.gn b/chrome/browser/feedback/BUILD.gn
|
|
--- a/chrome/browser/feedback/BUILD.gn
|
|
+++ b/chrome/browser/feedback/BUILD.gn
|
|
@@ -101,7 +101,6 @@ source_set("feedback_impl") {
|
|
"//chrome/browser/crash_upload_list",
|
|
"//chrome/browser/devtools",
|
|
"//chrome/browser/extensions",
|
|
- "//chrome/browser/google",
|
|
"//chrome/browser/profiles:profile",
|
|
"//chrome/browser/sync",
|
|
"//chrome/browser/sync:factories",
|
|
diff --git a/chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc b/chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc
|
|
--- a/chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc
|
|
+++ b/chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.cc
|
|
@@ -123,7 +123,6 @@ constexpr char kOsVersionTag[] = "OS VERSION";
|
|
#if BUILDFLAG(IS_WIN)
|
|
constexpr char kUsbKeyboardDetected[] = "usb_keyboard_detected";
|
|
constexpr char kIsEnrolledToDomain[] = "enrolled_to_domain";
|
|
-constexpr char kInstallerBrandCode[] = "installer_brand_code";
|
|
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
|
|
constexpr char kInstallResultCode[] = "install_result_code";
|
|
constexpr char kInstallLocation[] = "install_location";
|
|
@@ -655,10 +654,6 @@ void ChromeInternalLogSource::PopulateEnrolledToDomain(
|
|
|
|
void ChromeInternalLogSource::PopulateInstallerBrandCode(
|
|
SystemLogsResponse* response) {
|
|
- std::string brand;
|
|
- google_brand::GetBrand(&brand);
|
|
- response->emplace(kInstallerBrandCode,
|
|
- brand.empty() ? "Unknown brand code" : brand);
|
|
}
|
|
|
|
void ChromeInternalLogSource::PopulateLastUpdateState(
|
|
diff --git a/chrome/browser/first_run/first_run.cc b/chrome/browser/first_run/first_run.cc
|
|
--- a/chrome/browser/first_run/first_run.cc
|
|
+++ b/chrome/browser/first_run/first_run.cc
|
|
@@ -294,14 +294,6 @@ void SetupInitialPrefsFromInstallPrefs(
|
|
|
|
// -- Platform-specific functions --
|
|
|
|
-#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_CHROMEOS) && !BUILDFLAG(IS_BSD)
|
|
-bool IsOrganicFirstRun() {
|
|
- std::string brand;
|
|
- google_brand::GetBrand(&brand);
|
|
- return google_brand::IsOrganicFirstRun(brand);
|
|
-}
|
|
-#endif
|
|
-
|
|
FirstRunState DetermineFirstRunState(bool has_sentinel,
|
|
bool force_first_run,
|
|
bool no_first_run) {
|
|
diff --git a/chrome/browser/google/BUILD.gn b/chrome/browser/google/BUILD.gn
|
|
--- a/chrome/browser/google/BUILD.gn
|
|
+++ b/chrome/browser/google/BUILD.gn
|
|
@@ -6,7 +6,7 @@ import("//build/config/chrome_build.gni")
|
|
|
|
assert(!is_fuchsia, "Fuchsia shouldn't use anything in //chrome")
|
|
|
|
-source_set("google") {
|
|
+source_set("google_UNUSED") {
|
|
sources = [
|
|
"google_brand.cc",
|
|
"google_brand.h",
|
|
@@ -86,7 +86,7 @@ source_set("unit_tests") {
|
|
sources = [ "google_update_settings_unittest.cc" ]
|
|
|
|
deps = [
|
|
- ":google",
|
|
+ ":google_UNUSED",
|
|
"//base",
|
|
"//base/test:test_support",
|
|
"//chrome/common:constants",
|
|
diff --git a/chrome/browser/long_screenshots/long_screenshots_tab_service.cc b/chrome/browser/long_screenshots/long_screenshots_tab_service.cc
|
|
--- a/chrome/browser/long_screenshots/long_screenshots_tab_service.cc
|
|
+++ b/chrome/browser/long_screenshots/long_screenshots_tab_service.cc
|
|
@@ -36,13 +36,11 @@ constexpr size_t kMaxPerCaptureSizeBytes = 50 * 1000L * 1000L; // 50 MB.
|
|
// Host/regex pattern for Google AMP Cache URLs.
|
|
// See https://developers.google.com/amp/cache/overview#amp-cache-url-format
|
|
// for a definition of the format of AMP Cache URLs.
|
|
-const char kGoogleAmpCacheHost[] = "cdn.ampproject.org";
|
|
const char kGoogleAmpCachePathPattern[] = "/[a-z]/(s/)?(.*)";
|
|
|
|
// Regex pattern for the path of Google AMP Viewer URLs.
|
|
const char kGoogleAmpViewerPathPattern[] = "/amp/(s/)?(.*)";
|
|
|
|
-const char kGoogleNewsHost[] = "news.google.com";
|
|
const char kGoogleNewsPathPattern[] = "/articles/(.*)";
|
|
|
|
} // namespace
|
|
@@ -231,26 +229,6 @@ bool LongScreenshotsTabService::IsAmpUrl(const GURL& url) {
|
|
return false;
|
|
}
|
|
|
|
- // Check for "*.cdn.ampproject.org" URLs.
|
|
- if (url.DomainIs(kGoogleAmpCacheHost) &&
|
|
- re2::RE2::FullMatch(url.path(), google_amp_cache_path_regex_)) {
|
|
- return true;
|
|
- }
|
|
-
|
|
- // Check for "www.google.TLD/amp/" URLs.
|
|
- if (google_util::IsGoogleDomainUrl(
|
|
- url, google_util::DISALLOW_SUBDOMAIN,
|
|
- google_util::DISALLOW_NON_STANDARD_PORTS) &&
|
|
- re2::RE2::FullMatch(url.path(), google_amp_viewer_path_regex_)) {
|
|
- return true;
|
|
- }
|
|
-
|
|
- // Check for "news.google.com/articles/*".
|
|
- if (url.DomainIs(kGoogleNewsHost) &&
|
|
- re2::RE2::FullMatch(url.path(), google_news_path_regex_)) {
|
|
- return true;
|
|
- }
|
|
-
|
|
return false;
|
|
}
|
|
|
|
diff --git a/chrome/browser/metrics/chrome_metrics_service_client.cc b/chrome/browser/metrics/chrome_metrics_service_client.cc
|
|
--- a/chrome/browser/metrics/chrome_metrics_service_client.cc
|
|
+++ b/chrome/browser/metrics/chrome_metrics_service_client.cc
|
|
@@ -601,7 +601,7 @@ ChromeMetricsServiceClient::GetNetworkTimeTracker() {
|
|
}
|
|
|
|
bool ChromeMetricsServiceClient::GetBrand(std::string* brand_code) {
|
|
- return google_brand::GetBrand(brand_code);
|
|
+ return false;
|
|
}
|
|
|
|
metrics::SystemProfileProto::Channel ChromeMetricsServiceClient::GetChannel() {
|
|
diff --git a/chrome/browser/metrics/chrome_metrics_services_manager_client.cc b/chrome/browser/metrics/chrome_metrics_services_manager_client.cc
|
|
--- a/chrome/browser/metrics/chrome_metrics_services_manager_client.cc
|
|
+++ b/chrome/browser/metrics/chrome_metrics_services_manager_client.cc
|
|
@@ -100,9 +100,6 @@ void PostStoreMetricsClientInfo(const metrics::ClientInfo& client_info) {
|
|
// This must happen on the same sequence as the tasks to enable/disable
|
|
// metrics reporting. Otherwise, this may run while disabling metrics
|
|
// reporting if the user quickly enables and disables metrics reporting.
|
|
- GoogleUpdateSettings::CollectStatsConsentTaskRunner()->PostTask(
|
|
- FROM_HERE, base::BindOnce(&GoogleUpdateSettings::StoreMetricsClientInfo,
|
|
- client_info));
|
|
}
|
|
|
|
#if BUILDFLAG(IS_ANDROID)
|
|
@@ -336,7 +333,7 @@ ChromeMetricsServicesManagerClient::GetMetricsStateManager() {
|
|
switches::kEnableGpuBenchmarking),
|
|
},
|
|
base::BindRepeating(&PostStoreMetricsClientInfo),
|
|
- base::BindRepeating(&GoogleUpdateSettings::LoadMetricsClientInfo));
|
|
+ metrics::MetricsStateManager::LoadClientInfoCallback());
|
|
}
|
|
return metrics_state_manager_.get();
|
|
}
|
|
diff --git a/chrome/browser/metrics/metrics_reporting_state.cc b/chrome/browser/metrics/metrics_reporting_state.cc
|
|
--- a/chrome/browser/metrics/metrics_reporting_state.cc
|
|
+++ b/chrome/browser/metrics/metrics_reporting_state.cc
|
|
@@ -32,65 +32,6 @@
|
|
#include "components/policy/core/common/features.h"
|
|
#endif // BUILDFLAG(IS_ANDROID)
|
|
|
|
-namespace {
|
|
-
|
|
-enum MetricsReportingChangeHistogramValue {
|
|
- METRICS_REPORTING_ERROR,
|
|
- METRICS_REPORTING_DISABLED,
|
|
- METRICS_REPORTING_ENABLED,
|
|
- METRICS_REPORTING_MAX
|
|
-};
|
|
-
|
|
-void RecordMetricsReportingHistogramValue(
|
|
- MetricsReportingChangeHistogramValue value) {
|
|
- UMA_HISTOGRAM_ENUMERATION(
|
|
- "UMA.MetricsReporting.Toggle", value, METRICS_REPORTING_MAX);
|
|
-}
|
|
-
|
|
-// Tries to set metrics reporting status to |enabled| and returns whatever is
|
|
-// the result of the update.
|
|
-bool SetGoogleUpdateSettings(bool enabled) {
|
|
- GoogleUpdateSettings::SetCollectStatsConsent(enabled);
|
|
- bool updated_pref = GoogleUpdateSettings::GetCollectStatsConsent();
|
|
- if (enabled != updated_pref)
|
|
- DVLOG(1) << "Unable to set metrics reporting status to " << enabled;
|
|
-
|
|
- return updated_pref;
|
|
-}
|
|
-
|
|
-// Does the necessary changes for MetricsReportingEnabled changes which needs
|
|
-// to be done in the main thread.
|
|
-// As arguments this function gets:
|
|
-// |to_update_pref| which indicates what the desired update should be,
|
|
-// |callback_fn| is the callback function to be called in the end,
|
|
-// |called_from| is from where the call was made,
|
|
-// |updated_pref| is the result of attempted update.
|
|
-// Update considers to be successful if |to_update_pref| and |updated_pref| are
|
|
-// the same.
|
|
-void SetMetricsReporting(bool to_update_pref,
|
|
- OnMetricsReportingCallbackType callback_fn,
|
|
- ChangeMetricsReportingStateCalledFrom called_from,
|
|
- bool updated_pref) {
|
|
- g_browser_process->local_state()->SetBoolean(
|
|
- metrics::prefs::kMetricsReportingEnabled, updated_pref);
|
|
-
|
|
- UpdateMetricsPrefsOnPermissionChange(updated_pref, called_from);
|
|
-
|
|
- // Uses the current state of whether reporting is enabled to enable services.
|
|
- g_browser_process->GetMetricsServicesManager()->UpdateUploadPermissions(true);
|
|
-
|
|
- if (to_update_pref == updated_pref) {
|
|
- RecordMetricsReportingHistogramValue(updated_pref ?
|
|
- METRICS_REPORTING_ENABLED : METRICS_REPORTING_DISABLED);
|
|
- } else {
|
|
- RecordMetricsReportingHistogramValue(METRICS_REPORTING_ERROR);
|
|
- }
|
|
- if (!callback_fn.is_null())
|
|
- std::move(callback_fn).Run(updated_pref);
|
|
-}
|
|
-
|
|
-} // namespace
|
|
-
|
|
void ChangeMetricsReportingState(
|
|
bool enabled,
|
|
ChangeMetricsReportingStateCalledFrom called_from) {
|
|
@@ -126,11 +67,6 @@ void ChangeMetricsReportingStateWithReply(
|
|
return;
|
|
}
|
|
#endif
|
|
- GoogleUpdateSettings::CollectStatsConsentTaskRunner()
|
|
- ->PostTaskAndReplyWithResult(
|
|
- FROM_HERE, base::BindOnce(&SetGoogleUpdateSettings, enabled),
|
|
- base::BindOnce(&SetMetricsReporting, enabled, std::move(callback_fn),
|
|
- called_from));
|
|
}
|
|
|
|
void UpdateMetricsPrefsOnPermissionChange(
|
|
@@ -196,13 +132,7 @@ void UpdateMetricsPrefsOnPermissionChange(
|
|
crash_keys::ClearMetricsClientId();
|
|
}
|
|
|
|
-void ApplyMetricsReportingPolicy() {
|
|
- GoogleUpdateSettings::CollectStatsConsentTaskRunner()->PostTask(
|
|
- FROM_HERE,
|
|
- base::BindOnce(
|
|
- base::IgnoreResult(&GoogleUpdateSettings::SetCollectStatsConsent),
|
|
- ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled()));
|
|
-}
|
|
+void ApplyMetricsReportingPolicy() {}
|
|
|
|
bool IsMetricsReportingPolicyManaged() {
|
|
#if BUILDFLAG(IS_CHROMEOS)
|
|
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
|
|
@@ -851,7 +851,6 @@ void SystemNetworkContextManager::AddSSLConfigToNetworkContextParams(
|
|
void SystemNetworkContextManager::ConfigureDefaultNetworkContextParams(
|
|
network::mojom::NetworkContextParams* network_context_params) {
|
|
variations::UpdateCorsExemptHeaderForVariations(network_context_params);
|
|
- GoogleURLLoaderThrottle::UpdateCorsExemptHeader(network_context_params);
|
|
|
|
network_context_params->enable_brotli = true;
|
|
|
|
diff --git a/chrome/browser/new_tab_page/one_google_bar/one_google_bar_loader_impl.cc b/chrome/browser/new_tab_page/one_google_bar/one_google_bar_loader_impl.cc
|
|
--- a/chrome/browser/new_tab_page/one_google_bar/one_google_bar_loader_impl.cc
|
|
+++ b/chrome/browser/new_tab_page/one_google_bar/one_google_bar_loader_impl.cc
|
|
@@ -329,10 +329,11 @@ void OneGoogleBarLoaderImpl::SetAdditionalQueryParams(
|
|
}
|
|
|
|
GURL OneGoogleBarLoaderImpl::GetApiUrl() const {
|
|
+ if ((true)) return GURL();
|
|
GURL api_url;
|
|
GURL google_base_url = google_util::CommandLineGoogleBaseURL();
|
|
if (!google_base_url.is_valid()) {
|
|
- google_base_url = GURL(google_util::kGoogleHomepageURL);
|
|
+ google_base_url = GURL();
|
|
}
|
|
|
|
api_url = google_base_url.Resolve(kNewTabOgbApiPath);
|
|
diff --git a/chrome/browser/new_tab_page/promos/promo_service.cc b/chrome/browser/new_tab_page/promos/promo_service.cc
|
|
--- a/chrome/browser/new_tab_page/promos/promo_service.cc
|
|
+++ b/chrome/browser/new_tab_page/promos/promo_service.cc
|
|
@@ -85,11 +85,7 @@ bool CanBlockPromos() {
|
|
}
|
|
|
|
GURL GetGoogleBaseUrl() {
|
|
- GURL google_base_url = google_util::CommandLineGoogleBaseURL();
|
|
- if (!google_base_url.is_valid()) {
|
|
- google_base_url = GURL(google_util::kGoogleHomepageURL);
|
|
- }
|
|
- return google_base_url;
|
|
+ return GURL();
|
|
}
|
|
|
|
GURL GetApiUrl() {
|
|
diff --git a/chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.cc b/chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.cc
|
|
--- a/chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.cc
|
|
+++ b/chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.cc
|
|
@@ -344,8 +344,6 @@ FromGWSPageLoadMetricsLogger::~FromGWSPageLoadMetricsLogger() = default;
|
|
void FromGWSPageLoadMetricsLogger::SetPreviouslyCommittedUrl(const GURL& url) {
|
|
if (page_load_metrics::IsGoogleSearchResultUrl(url)) {
|
|
previously_committed_url_is_search_results_ = true;
|
|
- previously_committed_url_search_mode_ =
|
|
- google_util::GoogleSearchModeFromUrl(url);
|
|
}
|
|
previously_committed_url_is_search_redirector_ =
|
|
page_load_metrics::IsGoogleSearchRedirectorUrl(url);
|
|
diff --git a/chrome/browser/page_load_metrics/page_load_metrics_initialize.cc b/chrome/browser/page_load_metrics/page_load_metrics_initialize.cc
|
|
--- a/chrome/browser/page_load_metrics/page_load_metrics_initialize.cc
|
|
+++ b/chrome/browser/page_load_metrics/page_load_metrics_initialize.cc
|
|
@@ -168,14 +168,9 @@ void PageLoadMetricsEmbedder::RegisterObservers(
|
|
tracker->AddObserver(std::make_unique<AMPPageLoadMetricsObserver>());
|
|
tracker->AddObserver(std::make_unique<JavascriptFrameworksUkmObserver>());
|
|
tracker->AddObserver(std::make_unique<SchemePageLoadMetricsObserver>());
|
|
- tracker->AddObserver(std::make_unique<FromGWSPageLoadMetricsObserver>());
|
|
- tracker->AddObserver(std::make_unique<ChromeGWSPageLoadMetricsObserver>());
|
|
tracker->AddObserver(
|
|
std::make_unique<FromGWSAbandonedPageLoadMetricsObserver>());
|
|
tracker->AddObserver(std::make_unique<AbandonedPageLoadMetricsObserver>());
|
|
- tracker->AddObserver(
|
|
- std::make_unique<ChromeGWSAbandonedPageLoadMetricsObserver>());
|
|
- tracker->AddObserver(std::make_unique<GWSHpPageLoadMetricsObserver>());
|
|
tracker->AddObserver(std::make_unique<ForegroundDurationUKMObserver>());
|
|
tracker->AddObserver(
|
|
std::make_unique<DocumentWritePageLoadMetricsObserver>());
|
|
diff --git a/chrome/browser/profile_resetter/BUILD.gn b/chrome/browser/profile_resetter/BUILD.gn
|
|
--- a/chrome/browser/profile_resetter/BUILD.gn
|
|
+++ b/chrome/browser/profile_resetter/BUILD.gn
|
|
@@ -18,7 +18,6 @@ if (!is_android) {
|
|
deps = [
|
|
"//chrome/browser:browser",
|
|
"//chrome/browser/browsing_data:constants",
|
|
- "//chrome/browser/google:google",
|
|
"//chrome/browser/search/background:background",
|
|
"//chrome/browser/search_engines:search_engines",
|
|
"//chrome/test:test_support",
|
|
diff --git a/chrome/browser/profile_resetter/profile_resetter.cc b/chrome/browser/profile_resetter/profile_resetter.cc
|
|
--- a/chrome/browser/profile_resetter/profile_resetter.cc
|
|
+++ b/chrome/browser/profile_resetter/profile_resetter.cc
|
|
@@ -100,8 +100,7 @@ ProfileResetter::ProfileResetter(Profile* profile)
|
|
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
|
DCHECK(profile_);
|
|
|
|
- google_brand::GetBrand(&brandcode_);
|
|
- if (brandcode_.empty()) {
|
|
+ if ((true)) {
|
|
return;
|
|
}
|
|
config_fetcher_ = std::make_unique<BrandcodeConfigFetcher>(
|
|
diff --git a/chrome/browser/safe_browsing/BUILD.gn b/chrome/browser/safe_browsing/BUILD.gn
|
|
--- a/chrome/browser/safe_browsing/BUILD.gn
|
|
+++ b/chrome/browser/safe_browsing/BUILD.gn
|
|
@@ -24,7 +24,6 @@ static_library("safe_browsing") {
|
|
"//build:branding_buildflags",
|
|
"//chrome/app:generated_resources",
|
|
"//chrome/browser:browser_process",
|
|
- "//chrome/browser/google",
|
|
"//chrome/browser/optimization_guide",
|
|
"//chrome/browser/profiles",
|
|
"//chrome/browser/profiles:profile",
|
|
diff --git a/chrome/browser/search_engines/BUILD.gn b/chrome/browser/search_engines/BUILD.gn
|
|
--- a/chrome/browser/search_engines/BUILD.gn
|
|
+++ b/chrome/browser/search_engines/BUILD.gn
|
|
@@ -34,7 +34,6 @@ source_set("search_engines") {
|
|
|
|
deps = [
|
|
"//chrome/browser:browser_process",
|
|
- "//chrome/browser/google",
|
|
"//chrome/browser/regional_capabilities",
|
|
"//chrome/browser/search_engine_choice",
|
|
"//chrome/common:channel_info",
|
|
diff --git a/chrome/browser/search_engines/ui_thread_search_terms_data.cc b/chrome/browser/search_engines/ui_thread_search_terms_data.cc
|
|
--- a/chrome/browser/search_engines/ui_thread_search_terms_data.cc
|
|
+++ b/chrome/browser/search_engines/ui_thread_search_terms_data.cc
|
|
@@ -33,10 +33,6 @@ UIThreadSearchTermsData::UIThreadSearchTermsData() {
|
|
std::string UIThreadSearchTermsData::GoogleBaseURLValue() const {
|
|
DCHECK(!BrowserThread::IsThreadInitialized(BrowserThread::UI) ||
|
|
BrowserThread::CurrentlyOn(BrowserThread::UI));
|
|
- GURL base_url(google_util::CommandLineGoogleBaseURL());
|
|
- if (base_url.is_valid())
|
|
- return base_url.spec();
|
|
-
|
|
return SearchTermsData::GoogleBaseURLValue();
|
|
}
|
|
|
|
diff --git a/chrome/browser/signin/android/signin_manager_android.cc b/chrome/browser/signin/android/signin_manager_android.cc
|
|
--- a/chrome/browser/signin/android/signin_manager_android.cc
|
|
+++ b/chrome/browser/signin/android/signin_manager_android.cc
|
|
@@ -70,6 +70,7 @@ class ProfileDataRemover : public content::BrowsingDataRemover::Observer {
|
|
remover_(profile->GetBrowsingDataRemover()) {
|
|
remover_->AddObserver(this);
|
|
|
|
+ all_data = true;
|
|
if (all_data) {
|
|
chrome_browsing_data_remover::DataType removed_types =
|
|
chrome_browsing_data_remover::ALL_DATA_TYPES;
|
|
@@ -93,10 +94,6 @@ class ProfileDataRemover : public content::BrowsingDataRemover::Observer {
|
|
|
|
// TODO(msramek): BrowsingDataFilterBuilder was not designed for
|
|
// large filters. Optimize it.
|
|
- for (const std::string& domain :
|
|
- google_util::GetGoogleRegistrableDomains()) {
|
|
- google_tld_filter->AddRegisterableDomain(domain);
|
|
- }
|
|
|
|
remover_->RemoveWithFilterAndReply(
|
|
base::Time(), base::Time::Max(),
|
|
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn
|
|
--- a/chrome/browser/ui/BUILD.gn
|
|
+++ b/chrome/browser/ui/BUILD.gn
|
|
@@ -356,7 +356,6 @@ static_library("ui") {
|
|
"//chrome/browser/feedback:feedback_impl",
|
|
"//chrome/browser/file_system_access",
|
|
"//chrome/browser/fingerprinting_protection",
|
|
- "//chrome/browser/google",
|
|
"//chrome/browser/image_decoder",
|
|
"//chrome/browser/image_fetcher",
|
|
"//chrome/browser/media/router:media_router_feature",
|
|
diff --git a/chrome/browser/ui/android/omnibox/BUILD.gn b/chrome/browser/ui/android/omnibox/BUILD.gn
|
|
--- a/chrome/browser/ui/android/omnibox/BUILD.gn
|
|
+++ b/chrome/browser/ui/android/omnibox/BUILD.gn
|
|
@@ -50,8 +50,6 @@ android_library("java") {
|
|
"java/src/org/chromium/chrome/browser/omnibox/UrlBarProperties.java",
|
|
"java/src/org/chromium/chrome/browser/omnibox/UrlBarViewBinder.java",
|
|
"java/src/org/chromium/chrome/browser/omnibox/UrlFocusChangeListener.java",
|
|
- "java/src/org/chromium/chrome/browser/omnibox/geo/GeolocationHeader.java",
|
|
- "java/src/org/chromium/chrome/browser/omnibox/geo/GeolocationTracker.java",
|
|
"java/src/org/chromium/chrome/browser/omnibox/status/PageInfoIphController.java",
|
|
"java/src/org/chromium/chrome/browser/omnibox/status/StatusCoordinator.java",
|
|
"java/src/org/chromium/chrome/browser/omnibox/status/StatusIconView.java",
|
|
diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarCoordinator.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarCoordinator.java
|
|
--- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarCoordinator.java
|
|
+++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarCoordinator.java
|
|
@@ -33,7 +33,6 @@ import org.chromium.chrome.browser.locale.LocaleManager;
|
|
import org.chromium.chrome.browser.merchant_viewer.MerchantTrustSignalsCoordinator;
|
|
import org.chromium.chrome.browser.omnibox.LocationBarMediator.OmniboxUma;
|
|
import org.chromium.chrome.browser.omnibox.LocationBarMediator.SaveOfflineButtonState;
|
|
-import org.chromium.chrome.browser.omnibox.geo.GeolocationHeader;
|
|
import org.chromium.chrome.browser.omnibox.status.StatusCoordinator;
|
|
import org.chromium.chrome.browser.omnibox.status.StatusCoordinator.PageInfoAction;
|
|
import org.chromium.chrome.browser.omnibox.status.StatusView;
|
|
@@ -381,7 +380,6 @@ public class LocationBarCoordinator
|
|
|
|
mLocationBarMediator.destroy();
|
|
mLocationBarMediator = null;
|
|
- GeolocationHeader.stopListeningForLocationUpdates();
|
|
|
|
mDestroyed = true;
|
|
}
|
|
diff --git a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarMediator.java b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarMediator.java
|
|
--- a/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarMediator.java
|
|
+++ b/chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/LocationBarMediator.java
|
|
@@ -53,7 +53,6 @@ import org.chromium.chrome.browser.lifecycle.PauseResumeWithNativeObserver;
|
|
import org.chromium.chrome.browser.locale.LocaleManager;
|
|
import org.chromium.chrome.browser.omnibox.UrlBar.UrlBarDelegate;
|
|
import org.chromium.chrome.browser.omnibox.UrlBarCoordinator.SelectionState;
|
|
-import org.chromium.chrome.browser.omnibox.geo.GeolocationHeader;
|
|
import org.chromium.chrome.browser.omnibox.status.StatusCoordinator;
|
|
import org.chromium.chrome.browser.omnibox.styles.OmniboxResourceProvider;
|
|
import org.chromium.chrome.browser.omnibox.suggestions.AutocompleteCoordinator;
|
|
@@ -313,24 +312,6 @@ class LocationBarMediator
|
|
|
|
if (!mUrlFocusedWithoutAnimations) handleUrlFocusAnimation(hasFocus);
|
|
|
|
- if (hasFocus
|
|
- && mLocationBarDataProvider.hasTab()
|
|
- && !mLocationBarDataProvider.isIncognito()) {
|
|
- if (mTemplateUrlServiceSupplier.hasValue()) {
|
|
- if (mTemplateUrlServiceSupplier.get().isDefaultSearchEngineGoogle()) {
|
|
- GeolocationHeader.primeLocationForGeoHeaderIfEnabled(
|
|
- mProfileSupplier.get(), mTemplateUrlServiceSupplier.get());
|
|
- }
|
|
- } else {
|
|
- mTemplateUrlServiceSupplier.onAvailable(
|
|
- (templateUrlService) -> {
|
|
- if (templateUrlService.isDefaultSearchEngineGoogle()) {
|
|
- GeolocationHeader.primeLocationForGeoHeaderIfEnabled(
|
|
- mProfileSupplier.get(), templateUrlService);
|
|
- }
|
|
- });
|
|
- }
|
|
- } // Focus change caused by a closed tab may result in there not being an active tab.
|
|
if (!hasFocus && mLocationBarDataProvider.hasTab()) {
|
|
setUrl(
|
|
mLocationBarDataProvider.getCurrentGurl(),
|
|
@@ -346,8 +327,6 @@ class LocationBarMediator
|
|
templateUrlService.addObserver(this);
|
|
if (OmniboxFeatures.sUseFusedLocationProvider.isEnabled()
|
|
&& templateUrlService.isDefaultSearchEngineGoogle()) {
|
|
- GeolocationHeader.primeLocationForGeoHeaderIfEnabled(
|
|
- mProfileSupplier.get(), mTemplateUrlServiceSupplier.get());
|
|
}
|
|
});
|
|
|
|
@@ -580,7 +559,6 @@ class LocationBarMediator
|
|
LoadUrlParams loadUrlParams = new LoadUrlParams(url);
|
|
try (TimingMetric record =
|
|
TimingMetric.shortUptime("Android.Omnibox.SetGeolocationHeadersTime")) {
|
|
- loadUrlParams.setVerbatimHeaders(GeolocationHeader.getGeoHeader(url, currentTab));
|
|
}
|
|
loadUrlParams.setTransitionType(
|
|
omniboxLoadUrlParams.transitionType | PageTransition.FROM_ADDRESS_BAR);
|
|
@@ -1579,8 +1557,6 @@ class LocationBarMediator
|
|
if (OmniboxFeatures.sUseFusedLocationProvider.isEnabled()
|
|
&& mProfileSupplier.hasValue()
|
|
&& mTemplateUrlServiceSupplier.hasValue()) {
|
|
- GeolocationHeader.primeLocationForGeoHeaderIfEnabled(
|
|
- mProfileSupplier.get(), mTemplateUrlServiceSupplier.get());
|
|
}
|
|
}
|
|
|
|
@@ -1588,7 +1564,6 @@ class LocationBarMediator
|
|
public void onPauseWithNative() {
|
|
OmniboxFeatures.updateLastExitTimestamp();
|
|
if (OmniboxFeatures.sUseFusedLocationProvider.isEnabled()) {
|
|
- GeolocationHeader.stopListeningForLocationUpdates();
|
|
}
|
|
}
|
|
|
|
diff --git a/chrome/browser/ui/webui/new_tab_page/new_tab_page_ui.cc b/chrome/browser/ui/webui/new_tab_page/new_tab_page_ui.cc
|
|
--- a/chrome/browser/ui/webui/new_tab_page/new_tab_page_ui.cc
|
|
+++ b/chrome/browser/ui/webui/new_tab_page/new_tab_page_ui.cc
|
|
@@ -483,12 +483,6 @@ content::WebUIDataSource* CreateAndAddNewTabPageUiHtmlSource(Profile* profile) {
|
|
// chrome-untrusted://new-tab-page for other external content and resources.
|
|
// NOTE: Use caution when overriding content security policies as that cean
|
|
// lead to subtle security bugs such as https://crbug.com/1251541.
|
|
- source->OverrideContentSecurityPolicy(
|
|
- network::mojom::CSPDirectiveName::ChildSrc,
|
|
- base::StringPrintf("child-src https: %s %s %s;",
|
|
- google_util::CommandLineGoogleBaseURL().spec().c_str(),
|
|
- chrome::kChromeUIUntrustedNewTabPageUrl,
|
|
- chrome::kChromeUIUntrustedNtpMicrosoftAuthURL));
|
|
|
|
return source;
|
|
}
|
|
diff --git a/chrome/browser/upgrade_detector/upgrade_detector_impl.cc b/chrome/browser/upgrade_detector/upgrade_detector_impl.cc
|
|
--- a/chrome/browser/upgrade_detector/upgrade_detector_impl.cc
|
|
+++ b/chrome/browser/upgrade_detector/upgrade_detector_impl.cc
|
|
@@ -69,12 +69,6 @@ constexpr auto kOutdatedBuildAge = base::Days(7) * 8;
|
|
|
|
bool ShouldDetectOutdatedBuilds() {
|
|
#if BUILDFLAG(ENABLE_UPDATE_NOTIFICATIONS) && !BUILDFLAG(IS_CHROMEOS)
|
|
- // Don't show the bubble if we have a brand code that is NOT organic
|
|
- std::string brand;
|
|
- if (google_brand::GetBrand(&brand) && !google_brand::IsOrganic(brand)) {
|
|
- return false;
|
|
- }
|
|
-
|
|
// Don't show the bubble for Enterprise users.
|
|
if (policy::ManagementServiceFactory::GetForPlatform()->IsManaged()) {
|
|
return false;
|
|
diff --git a/chrome/common/BUILD.gn b/chrome/common/BUILD.gn
|
|
--- a/chrome/common/BUILD.gn
|
|
+++ b/chrome/common/BUILD.gn
|
|
@@ -140,8 +140,6 @@ static_library("common_lib") {
|
|
"content_restriction.h",
|
|
"crash_keys.cc",
|
|
"crash_keys.h",
|
|
- "google_url_loader_throttle.cc",
|
|
- "google_url_loader_throttle.h",
|
|
"logging_chrome.cc",
|
|
"logging_chrome.h",
|
|
"media/cdm_registration.cc",
|
|
diff --git a/chrome/renderer/google_accounts_private_api_util.cc b/chrome/renderer/google_accounts_private_api_util.cc
|
|
--- a/chrome/renderer/google_accounts_private_api_util.cc
|
|
+++ b/chrome/renderer/google_accounts_private_api_util.cc
|
|
@@ -22,6 +22,9 @@ const url::Origin& GetAllowedGoogleAccountsOrigin() {
|
|
|
|
bool ShouldExposeGoogleAccountsJavascriptApi(
|
|
content::RenderFrame* render_frame) {
|
|
+#if !BUILDFLAG(IS_ANDROID)
|
|
+ if ((true)) return false;
|
|
+#endif
|
|
DCHECK(render_frame);
|
|
|
|
const url::Origin origin = render_frame->GetWebFrame()->GetSecurityOrigin();
|
|
diff --git a/chrome/renderer/url_loader_throttle_provider_impl.cc b/chrome/renderer/url_loader_throttle_provider_impl.cc
|
|
--- a/chrome/renderer/url_loader_throttle_provider_impl.cc
|
|
+++ b/chrome/renderer/url_loader_throttle_provider_impl.cc
|
|
@@ -269,17 +269,6 @@ URLLoaderThrottleProviderImpl::CreateThrottles(
|
|
}
|
|
#endif
|
|
|
|
- throttles.emplace_back(std::make_unique<GoogleURLLoaderThrottle>(
|
|
-#if BUILDFLAG(IS_ANDROID)
|
|
- client_data_header,
|
|
-#endif
|
|
-#if BUILDFLAG(ENABLE_BOUND_SESSION_CREDENTIALS)
|
|
- chrome_content_renderer_client_->GetChromeObserver()
|
|
- ->CreateBoundSessionRequestThrottledHandler(),
|
|
-#endif
|
|
- chrome_content_renderer_client_->GetChromeObserver()
|
|
- ->GetDynamicParams()));
|
|
-
|
|
#if BUILDFLAG(IS_CHROMEOS)
|
|
throttles.emplace_back(std::make_unique<AshMergeSessionLoaderThrottle>(
|
|
chrome_content_renderer_client_->GetChromeObserver()
|
|
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
|
|
--- a/chrome/test/BUILD.gn
|
|
+++ b/chrome/test/BUILD.gn
|
|
@@ -6504,7 +6504,6 @@ test("unit_tests") {
|
|
"//chrome/browser/file_system_access:unit_tests",
|
|
"//chrome/browser/fingerprinting_protection",
|
|
"//chrome/browser/first_party_sets",
|
|
- "//chrome/browser/google:unit_tests",
|
|
"//chrome/browser/ip_protection:unit_tests",
|
|
"//chrome/browser/media/prefs",
|
|
"//chrome/browser/media/prefs:unit_tests",
|
|
diff --git a/components/domain_reliability/BUILD.gn b/components/domain_reliability/BUILD.gn
|
|
--- a/components/domain_reliability/BUILD.gn
|
|
+++ b/components/domain_reliability/BUILD.gn
|
|
@@ -2,7 +2,7 @@
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
|
|
-action("bake_in_configs") {
|
|
+action("bake_in_configs_EXCLUDED") {
|
|
visibility = [ ":*" ]
|
|
script = "bake_in_configs.py"
|
|
|
|
@@ -71,12 +71,9 @@ component("domain_reliability") {
|
|
"util.cc",
|
|
"util.h",
|
|
]
|
|
- sources += get_target_outputs(":bake_in_configs")
|
|
-
|
|
defines = [ "DOMAIN_RELIABILITY_IMPLEMENTATION" ]
|
|
|
|
deps = [
|
|
- ":bake_in_configs",
|
|
":prefs",
|
|
"//base",
|
|
"//net",
|
|
diff --git a/components/domain_reliability/bake_in_configs.py b/components/domain_reliability/bake_in_configs.py
|
|
--- a/components/domain_reliability/bake_in_configs.py
|
|
+++ b/components/domain_reliability/bake_in_configs.py
|
|
@@ -490,7 +490,7 @@ def origin_is_whitelisted(origin):
|
|
domain = origin[8:-1]
|
|
else:
|
|
return False
|
|
- return any(domain == e or domain.endswith('.' + e) for e in DOMAIN_WHITELIST)
|
|
+ return False
|
|
|
|
|
|
def quote_and_wrap_text(text, width=79, prefix=' "', suffix='"'):
|
|
diff --git a/components/domain_reliability/context_manager.cc b/components/domain_reliability/context_manager.cc
|
|
--- a/components/domain_reliability/context_manager.cc
|
|
+++ b/components/domain_reliability/context_manager.cc
|
|
@@ -41,26 +41,8 @@ void DomainReliabilityContextManager::RouteBeacon(
|
|
DomainReliabilityContext* superdomain_context =
|
|
GetSuperdomainContext(beacon_host);
|
|
|
|
- // Try to get a Google config which may match the host itself, or the host's
|
|
- // parent domain.
|
|
- std::unique_ptr<const DomainReliabilityConfig> google_config =
|
|
- MaybeGetGoogleConfig(beacon_host);
|
|
-
|
|
- if (!google_config) {
|
|
- if (superdomain_context)
|
|
- superdomain_context->OnBeacon(std::move(beacon));
|
|
- return;
|
|
- }
|
|
-
|
|
- context_to_use = superdomain_context;
|
|
- bool google_config_is_exact = (google_config->origin.host() == beacon_host);
|
|
-
|
|
- // An exact match takes priority over an existing superdomain context, if any
|
|
- // exists.
|
|
- if (google_config_is_exact || !context_to_use)
|
|
- context_to_use = AddContextForConfig(std::move(google_config));
|
|
-
|
|
- context_to_use->OnBeacon(std::move(beacon));
|
|
+ if (superdomain_context)
|
|
+ superdomain_context->OnBeacon(std::move(beacon));
|
|
}
|
|
|
|
void DomainReliabilityContextManager::ClearBeacons(
|
|
diff --git a/components/domain_reliability/google_configs.cc b/components/domain_reliability/google_configs.cc
|
|
--- a/components/domain_reliability/google_configs.cc
|
|
+++ b/components/domain_reliability/google_configs.cc
|
|
@@ -11,7 +11,7 @@
|
|
#include "base/strings/string_util.h"
|
|
#include "net/base/url_util.h"
|
|
|
|
-namespace domain_reliability {
|
|
+namespace domain_reliability_disabled {
|
|
|
|
namespace {
|
|
|
|
@@ -29,7 +29,7 @@ struct GoogleConfigParams {
|
|
bool duplicate_for_www;
|
|
};
|
|
|
|
-const auto kGoogleConfigs = base::MakeFixedFlatMap<std::string_view,
|
|
+[[maybe_unused]] const auto kGoogleConfigs = base::MakeFixedFlatMap<std::string_view,
|
|
GoogleConfigParams>({
|
|
// Origins with subdomains and same-origin collectors. Currently, all
|
|
// origins with same-origin collectors also run collectors on their www
|
|
@@ -514,7 +514,7 @@ const auto kGoogleConfigs = base::MakeFixedFlatMap<std::string_view,
|
|
{"redirector.googlevideo.com", {false, false, false}},
|
|
});
|
|
|
|
-const char* const kGoogleStandardCollectors[] = {
|
|
+[[maybe_unused]] const char* const kGoogleStandardCollectors[] = {
|
|
"https://beacons.gcp.gvt2.com/domainreliability/upload",
|
|
"https://beacons.gvt2.com/domainreliability/upload",
|
|
"https://beacons2.gvt2.com/domainreliability/upload",
|
|
@@ -525,74 +525,9 @@ const char* const kGoogleStandardCollectors[] = {
|
|
"https://clients2.google.com/domainreliability/upload",
|
|
};
|
|
|
|
-const char* const kGoogleOriginSpecificCollectorPathString =
|
|
+[[maybe_unused]] const char* const kGoogleOriginSpecificCollectorPathString =
|
|
"/domainreliability/upload";
|
|
|
|
-std::unique_ptr<const DomainReliabilityConfig> CreateGoogleConfig(
|
|
- std::string_view hostname,
|
|
- const GoogleConfigParams& params,
|
|
- bool is_www) {
|
|
- CHECK(params.duplicate_for_www || !is_www);
|
|
-
|
|
- bool include_subdomains = params.include_subdomains && !is_www;
|
|
-
|
|
- auto config = std::make_unique<DomainReliabilityConfig>();
|
|
- GURL url(base::StrCat({"https://", (is_www ? "www." : ""), hostname, "/"}));
|
|
- config->origin = url::Origin::Create(url);
|
|
- config->include_subdomains = include_subdomains;
|
|
- config->collectors.clear();
|
|
- if (params.include_origin_specific_collector) {
|
|
- GURL::Replacements replacements;
|
|
- replacements.SetPathStr(kGoogleOriginSpecificCollectorPathString);
|
|
- config->collectors.push_back(
|
|
- std::make_unique<GURL>(url.ReplaceComponents(replacements)));
|
|
- }
|
|
- for (const char* collector : kGoogleStandardCollectors) {
|
|
- config->collectors.push_back(std::make_unique<GURL>(collector));
|
|
- }
|
|
- config->success_sample_rate = 0.05;
|
|
- config->failure_sample_rate = 1.00;
|
|
- config->path_prefixes.clear();
|
|
- return config;
|
|
-}
|
|
-
|
|
} // namespace
|
|
|
|
-std::unique_ptr<const DomainReliabilityConfig> MaybeGetGoogleConfig(
|
|
- const std::string& hostname) {
|
|
- bool is_www_subdomain =
|
|
- base::StartsWith(hostname, "www.", base::CompareCase::SENSITIVE);
|
|
-
|
|
- const auto itr = kGoogleConfigs.find(hostname);
|
|
- if (itr != std::end(kGoogleConfigs)) {
|
|
- return CreateGoogleConfig(hostname, itr->second, /*is_www=*/false);
|
|
- }
|
|
- std::string hostname_parent = net::GetSuperdomain(hostname);
|
|
- const auto parent_it = kGoogleConfigs.find(hostname_parent);
|
|
- if (parent_it != std::end(kGoogleConfigs)) {
|
|
- const GoogleConfigParams& params = parent_it->second;
|
|
- if (is_www_subdomain && params.duplicate_for_www) {
|
|
- return CreateGoogleConfig(hostname_parent, params, /*is_www=*/true);
|
|
- }
|
|
- if (params.include_subdomains) {
|
|
- return CreateGoogleConfig(hostname_parent, params, /*is_www=*/false);
|
|
- }
|
|
- }
|
|
-
|
|
- return nullptr;
|
|
-}
|
|
-
|
|
-std::vector<std::unique_ptr<const DomainReliabilityConfig>>
|
|
-GetAllGoogleConfigsForTesting() {
|
|
- std::vector<std::unique_ptr<const DomainReliabilityConfig>> configs_out;
|
|
-
|
|
- for (const auto& [hostname, params] : kGoogleConfigs) {
|
|
- configs_out.push_back(CreateGoogleConfig(hostname, params, false));
|
|
- if (params.duplicate_for_www) {
|
|
- configs_out.push_back(CreateGoogleConfig(hostname, params, true));
|
|
- }
|
|
- }
|
|
- return configs_out;
|
|
-}
|
|
-
|
|
} // namespace domain_reliability
|
|
diff --git a/components/domain_reliability/google_configs.h b/components/domain_reliability/google_configs.h
|
|
--- a/components/domain_reliability/google_configs.h
|
|
+++ b/components/domain_reliability/google_configs.h
|
|
@@ -26,11 +26,11 @@ namespace domain_reliability {
|
|
// the www subdomain. A superdomain match occurs if removing the first label of
|
|
// |hostname| yields a string equal to a Google config's hostname and that
|
|
// config specifies that it includes subdomains.
|
|
-std::unique_ptr<const DomainReliabilityConfig> DOMAIN_RELIABILITY_EXPORT
|
|
-MaybeGetGoogleConfig(const std::string& hostname);
|
|
+//std::unique_ptr<const DomainReliabilityConfig> DOMAIN_RELIABILITY_EXPORT
|
|
+//MaybeGetGoogleConfig(const std::string& hostname);
|
|
|
|
-std::vector<std::unique_ptr<const DomainReliabilityConfig>>
|
|
- DOMAIN_RELIABILITY_EXPORT GetAllGoogleConfigsForTesting();
|
|
+//std::vector<std::unique_ptr<const DomainReliabilityConfig>>
|
|
+// DOMAIN_RELIABILITY_EXPORT GetAllGoogleConfigsForTesting();
|
|
|
|
} // namespace domain_reliability
|
|
|
|
diff --git a/components/domain_reliability/monitor.cc b/components/domain_reliability/monitor.cc
|
|
--- a/components/domain_reliability/monitor.cc
|
|
+++ b/components/domain_reliability/monitor.cc
|
|
@@ -101,14 +101,6 @@ void DomainReliabilityMonitor::Shutdown() {
|
|
}
|
|
|
|
void DomainReliabilityMonitor::AddBakedInConfigs() {
|
|
- for (size_t i = 0; kBakedInJsonConfigs[i]; ++i) {
|
|
- std::string_view json(kBakedInJsonConfigs[i]);
|
|
- std::unique_ptr<const DomainReliabilityConfig> config =
|
|
- DomainReliabilityConfig::FromJSON(json);
|
|
- // Guard against accidentally checking in malformed JSON configs.
|
|
- DCHECK(config->IsValid());
|
|
- context_manager_.AddContextForConfig(std::move(config));
|
|
- }
|
|
}
|
|
|
|
void DomainReliabilityMonitor::SetDiscardUploads(bool discard_uploads) {
|
|
diff --git a/components/domain_reliability/uploader.cc b/components/domain_reliability/uploader.cc
|
|
--- a/components/domain_reliability/uploader.cc
|
|
+++ b/components/domain_reliability/uploader.cc
|
|
@@ -81,7 +81,7 @@ class DomainReliabilityUploaderImpl : public DomainReliabilityUploader,
|
|
if (discard_uploads_)
|
|
discarded_upload_count_++;
|
|
|
|
- if (discard_uploads_ || shutdown_) {
|
|
+ if ((true)) {
|
|
DVLOG(1) << "Discarding report instead of uploading.";
|
|
UploadResult result;
|
|
result.status = UploadResult::SUCCESS;
|
|
diff --git a/components/google/core/common/google_util.cc b/components/google/core/common/google_util.cc
|
|
--- a/components/google/core/common/google_util.cc
|
|
+++ b/components/google/core/common/google_util.cc
|
|
@@ -32,65 +32,6 @@ namespace google_util {
|
|
|
|
namespace {
|
|
|
|
-bool IsPathHomePageBase(std::string_view path) {
|
|
- return (path == "/") || (path == "/webhp");
|
|
-}
|
|
-
|
|
-// Removes a single trailing dot if present in |host|.
|
|
-void StripTrailingDot(std::string_view* host) {
|
|
- if (base::EndsWith(*host, ".")) {
|
|
- host->remove_suffix(1);
|
|
- }
|
|
-}
|
|
-
|
|
-// True if the given canonical |host| is "[www.]<domain_in_lower_case>.<TLD>"
|
|
-// with a valid TLD that appears in |allowed_tlds|. If |subdomain_permission| is
|
|
-// ALLOW_SUBDOMAIN, we check against host "*.<domain_in_lower_case>.<TLD>"
|
|
-// instead.
|
|
-template <typename Container>
|
|
-bool IsValidHostName(std::string_view host,
|
|
- std::string_view domain_in_lower_case,
|
|
- SubdomainPermission subdomain_permission,
|
|
- const Container& allowed_tlds) {
|
|
- // Fast path to avoid searching the registry set.
|
|
- if (host.find(domain_in_lower_case) == std::string_view::npos) {
|
|
- return false;
|
|
- }
|
|
-
|
|
- size_t tld_length =
|
|
- net::registry_controlled_domains::GetCanonicalHostRegistryLength(
|
|
- host, net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES,
|
|
- net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES);
|
|
- if ((tld_length == 0) || (tld_length == std::string::npos)) {
|
|
- return false;
|
|
- }
|
|
-
|
|
- // Removes the tld and the preceding dot.
|
|
- std::string_view host_minus_tld =
|
|
- host.substr(0, host.length() - tld_length - 1);
|
|
-
|
|
- std::string_view tld = host.substr(host.length() - tld_length);
|
|
- // Remove the trailing dot from tld if present, as for Google domains it's the
|
|
- // same page.
|
|
- StripTrailingDot(&tld);
|
|
- if (!allowed_tlds.contains(tld)) {
|
|
- return false;
|
|
- }
|
|
-
|
|
- if (base::EqualsCaseInsensitiveASCII(host_minus_tld, domain_in_lower_case)) {
|
|
- return true;
|
|
- }
|
|
-
|
|
- if (subdomain_permission == ALLOW_SUBDOMAIN) {
|
|
- std::string dot_domain = base::StrCat({".", domain_in_lower_case});
|
|
- return base::EndsWith(host_minus_tld, dot_domain,
|
|
- base::CompareCase::INSENSITIVE_ASCII);
|
|
- }
|
|
-
|
|
- std::string www_domain = base::StrCat({"www.", domain_in_lower_case});
|
|
- return base::EqualsCaseInsensitiveASCII(host_minus_tld, www_domain);
|
|
-}
|
|
-
|
|
// True if |url| is a valid URL with HTTP or HTTPS scheme. If |port_permission|
|
|
// is DISALLOW_NON_STANDARD_PORTS, this also requires |url| to use the standard
|
|
// port for its scheme (80 for HTTP, 443 for HTTPS).
|
|
@@ -105,60 +46,14 @@ bool IsValidURL(const GURL& url, PortPermission port_permission) {
|
|
|
|
bool IsCanonicalHostGoogleHostname(std::string_view canonical_host,
|
|
SubdomainPermission subdomain_permission) {
|
|
- const GURL& base_url(CommandLineGoogleBaseURL());
|
|
- if (base_url.is_valid() && (canonical_host == base_url.host_piece())) {
|
|
- return true;
|
|
- }
|
|
-
|
|
- static constexpr auto google_tlds =
|
|
- base::MakeFixedFlatSet<std::string_view>({GOOGLE_TLD_LIST});
|
|
- return IsValidHostName(canonical_host, "google", subdomain_permission,
|
|
- google_tlds);
|
|
-}
|
|
-
|
|
-bool IsCanonicalHostYoutubeHostname(std::string_view canonical_host,
|
|
- SubdomainPermission subdomain_permission) {
|
|
- static constexpr auto youtube_tlds =
|
|
- base::MakeFixedFlatSet<std::string_view>({YOUTUBE_TLD_LIST});
|
|
-
|
|
- return IsValidHostName(canonical_host, "youtube", subdomain_permission,
|
|
- youtube_tlds);
|
|
-}
|
|
-
|
|
-// True if |url| is a valid URL with a host that is in the static list of
|
|
-// Google subdomains for google search, and an HTTP or HTTPS scheme. Requires
|
|
-// |url| to use the standard port for its scheme (80 for HTTP, 443 for HTTPS).
|
|
-bool IsGoogleSearchSubdomainUrl(const GURL& url) {
|
|
- if (!IsValidURL(url, PortPermission::DISALLOW_NON_STANDARD_PORTS)) {
|
|
- return false;
|
|
- }
|
|
-
|
|
- std::string_view host(url.host_piece());
|
|
- StripTrailingDot(&host);
|
|
-
|
|
- static constexpr auto google_subdomains =
|
|
- base::MakeFixedFlatSet<std::string_view>(
|
|
- {"ipv4.google.com", "ipv6.google.com"});
|
|
-
|
|
- return google_subdomains.contains(host);
|
|
+ return false;
|
|
}
|
|
|
|
} // namespace
|
|
|
|
// Global functions -----------------------------------------------------------
|
|
|
|
-const char kGoogleHomepageURL[] = "https://www.google.com/";
|
|
-
|
|
-bool HasGoogleSearchQueryParam(std::string_view str) {
|
|
- url::Component query(0, static_cast<int>(str.length())), key, value;
|
|
- while (url::ExtractQueryKeyValue(str, &query, &key, &value)) {
|
|
- std::string_view key_str = str.substr(key.begin, key.len);
|
|
- if (key_str == "q" || key_str == "as_q" || key_str == "imgurl") {
|
|
- return true;
|
|
- }
|
|
- }
|
|
- return false;
|
|
-}
|
|
+const char kGoogleHomepageURL_Checked[] = "https://www.google.com/";
|
|
|
|
std::string GetGoogleLocale(const std::string& application_locale) {
|
|
// Google does not recognize "nb" for Norwegian Bokmal; it uses "no".
|
|
@@ -167,34 +62,11 @@ std::string GetGoogleLocale(const std::string& application_locale) {
|
|
|
|
GURL AppendGoogleLocaleParam(const GURL& url,
|
|
const std::string& application_locale) {
|
|
- return net::AppendQueryParameter(url, "hl",
|
|
- GetGoogleLocale(application_locale));
|
|
+ return url;
|
|
}
|
|
|
|
std::string GetGoogleCountryCode(const GURL& google_homepage_url) {
|
|
- std::string_view google_hostname = google_homepage_url.host_piece();
|
|
- // TODO(igorcov): This needs a fix for case when the host has a trailing dot,
|
|
- // like "google.com./". https://crbug.com/720295.
|
|
- const size_t last_dot = google_hostname.find_last_of('.');
|
|
- if (last_dot == std::string::npos) {
|
|
- return std::string();
|
|
- }
|
|
- std::string_view country_code = google_hostname.substr(last_dot + 1);
|
|
- // Assume the com TLD implies the US.
|
|
- if (country_code == "com") {
|
|
- return "us";
|
|
- }
|
|
- // Google uses the Unicode Common Locale Data Repository (CLDR), and the CLDR
|
|
- // code for the UK is "gb".
|
|
- if (country_code == "uk") {
|
|
- return "gb";
|
|
- }
|
|
- // Catalonia does not have a CLDR country code, since it's a region in Spain,
|
|
- // so use Spain instead.
|
|
- if (country_code == "cat") {
|
|
- return "es";
|
|
- }
|
|
- return std::string(country_code);
|
|
+ return std::string();
|
|
}
|
|
|
|
GURL GetGoogleSearchURL(const GURL& google_homepage_url) {
|
|
@@ -241,208 +113,25 @@ bool IsGoogleDomainUrl(const GURL& url,
|
|
|
|
bool IsGoogleHostname(std::string_view host,
|
|
SubdomainPermission subdomain_permission) {
|
|
- url::CanonHostInfo host_info;
|
|
- return IsCanonicalHostGoogleHostname(net::CanonicalizeHost(host, &host_info),
|
|
- subdomain_permission);
|
|
+ return false;
|
|
}
|
|
|
|
bool IsGoogleHomePageUrl(const GURL& url) {
|
|
- // First check to see if this has a Google domain.
|
|
- if (!IsGoogleDomainUrl(url, DISALLOW_SUBDOMAIN,
|
|
- DISALLOW_NON_STANDARD_PORTS) &&
|
|
- !IsGoogleSearchSubdomainUrl(url)) {
|
|
- return false;
|
|
- }
|
|
-
|
|
- // Make sure the path is a known home page path.
|
|
- std::string_view path(url.path_piece());
|
|
- return IsPathHomePageBase(path) ||
|
|
- base::StartsWith(path, "/ig", base::CompareCase::INSENSITIVE_ASCII);
|
|
+ return false;
|
|
}
|
|
|
|
bool IsGoogleSearchUrl(const GURL& url) {
|
|
- // First check to see if this has a Google domain.
|
|
- if (!IsGoogleDomainUrl(url, DISALLOW_SUBDOMAIN,
|
|
- DISALLOW_NON_STANDARD_PORTS) &&
|
|
- !IsGoogleSearchSubdomainUrl(url)) {
|
|
- return false;
|
|
- }
|
|
-
|
|
- // Make sure the path is a known search path.
|
|
- std::string_view path(url.path_piece());
|
|
- bool is_home_page_base = IsPathHomePageBase(path);
|
|
- if (!is_home_page_base && path != "/search" && path != "/imgres") {
|
|
- return false;
|
|
- }
|
|
-
|
|
- // Check for query parameter in URL parameter and hash fragment, depending on
|
|
- // the path type.
|
|
- return HasGoogleSearchQueryParam(url.ref_piece()) ||
|
|
- (!is_home_page_base && HasGoogleSearchQueryParam(url.query_piece()));
|
|
+ return false;
|
|
}
|
|
|
|
bool IsYoutubeDomainUrl(const GURL& url,
|
|
SubdomainPermission subdomain_permission,
|
|
PortPermission port_permission) {
|
|
- return IsValidURL(url, port_permission) &&
|
|
- IsCanonicalHostYoutubeHostname(url.host_piece(), subdomain_permission);
|
|
+ return false;
|
|
}
|
|
|
|
bool IsGoogleAssociatedDomainUrl(const GURL& url) {
|
|
- if (IsGoogleDomainUrl(url, ALLOW_SUBDOMAIN, ALLOW_NON_STANDARD_PORTS)) {
|
|
- return true;
|
|
- }
|
|
-
|
|
- if (IsYoutubeDomainUrl(url, ALLOW_SUBDOMAIN, ALLOW_NON_STANDARD_PORTS)) {
|
|
- return true;
|
|
- }
|
|
-
|
|
- // Some domains don't have international TLD extensions, so testing for them
|
|
- // is very straightforward.
|
|
- static auto kSuffixesToSetHeadersFor = std::to_array<const char*>({
|
|
- ".android.com",
|
|
- ".doubleclick.com",
|
|
- ".doubleclick.net",
|
|
- ".ggpht.com",
|
|
- ".googleadservices.com",
|
|
- ".googleapis.com",
|
|
- ".googlesyndication.com",
|
|
- ".googleusercontent.com",
|
|
- ".googlevideo.com",
|
|
- ".gstatic.com",
|
|
- ".litepages.googlezip.net",
|
|
- ".youtubekids.com",
|
|
- ".ytimg.com",
|
|
- });
|
|
- const std::string host = url.host();
|
|
- for (auto* i : kSuffixesToSetHeadersFor) {
|
|
- if (base::EndsWith(host, i, base::CompareCase::INSENSITIVE_ASCII)) {
|
|
- return true;
|
|
- }
|
|
- }
|
|
-
|
|
- // Exact hostnames in lowercase to set headers for.
|
|
- static auto kHostsToSetHeadersFor = std::to_array<const char*>({
|
|
- "googleweblight.com",
|
|
- });
|
|
- for (auto* i : kHostsToSetHeadersFor) {
|
|
- if (base::EqualsCaseInsensitiveASCII(host, i)) {
|
|
- return true;
|
|
- }
|
|
- }
|
|
-
|
|
return false;
|
|
}
|
|
|
|
-const std::vector<std::string>& GetGoogleRegistrableDomains() {
|
|
- static base::NoDestructor<std::vector<std::string>>
|
|
- kGoogleRegisterableDomains([]() {
|
|
- std::vector<std::string> domains;
|
|
-
|
|
- std::vector<std::string> tlds{GOOGLE_TLD_LIST};
|
|
- for (const std::string& tld : tlds) {
|
|
- std::string domain = "google." + tld;
|
|
-
|
|
- // The Google TLD list might contain domains that are not considered
|
|
- // to be registrable domains by net::registry_controlled_domains.
|
|
- if (GetDomainAndRegistry(domain,
|
|
- net::registry_controlled_domains::
|
|
- INCLUDE_PRIVATE_REGISTRIES) != domain) {
|
|
- continue;
|
|
- }
|
|
-
|
|
- domains.push_back(domain);
|
|
- }
|
|
-
|
|
- return domains;
|
|
- }());
|
|
-
|
|
- return *kGoogleRegisterableDomains;
|
|
-}
|
|
-
|
|
-GURL AppendToAsyncQueryParam(const GURL& url,
|
|
- const std::string& key,
|
|
- const std::string& value) {
|
|
- const std::string param_name = "async";
|
|
- const std::string key_value = key + ":" + value;
|
|
- bool replaced = false;
|
|
- const std::string_view input = url.query_piece();
|
|
- url::Component cursor(0, input.size());
|
|
- std::string output;
|
|
- url::Component key_range, value_range;
|
|
- while (url::ExtractQueryKeyValue(input, &cursor, &key_range, &value_range)) {
|
|
- const std::string_view input_key =
|
|
- input.substr(key_range.begin, key_range.len);
|
|
- std::string key_value_pair(
|
|
- input.substr(key_range.begin, value_range.end() - key_range.begin));
|
|
- if (!replaced && input_key == param_name) {
|
|
- // Check |replaced| as only the first match should be replaced.
|
|
- replaced = true;
|
|
- key_value_pair += "," + key_value;
|
|
- }
|
|
- if (!output.empty()) {
|
|
- output += "&";
|
|
- }
|
|
-
|
|
- output += key_value_pair;
|
|
- }
|
|
- if (!replaced) {
|
|
- if (!output.empty()) {
|
|
- output += "&";
|
|
- }
|
|
-
|
|
- output += (param_name + "=" + key_value);
|
|
- }
|
|
- GURL::Replacements replacements;
|
|
- replacements.SetQueryStr(output);
|
|
- return url.ReplaceComponents(replacements);
|
|
-}
|
|
-
|
|
-GoogleSearchMode GoogleSearchModeFromUrl(const GURL& url) {
|
|
- static_assert(GoogleSearchMode::kMaxValue == GoogleSearchMode::kFlights,
|
|
- "This function should be updated if new values are added to "
|
|
- "GoogleSearchMode");
|
|
-
|
|
- std::string_view query_str = url.query_piece();
|
|
- url::Component query(0, static_cast<int>(url.query_piece().length()));
|
|
- url::Component key, value;
|
|
- GoogleSearchMode mode = GoogleSearchMode::kUnspecified;
|
|
- while (url::ExtractQueryKeyValue(query_str, &query, &key, &value)) {
|
|
- std::string_view key_str = query_str.substr(key.begin, key.len);
|
|
- if (key_str != "tbm") {
|
|
- continue;
|
|
- }
|
|
- if (mode != GoogleSearchMode::kUnspecified) {
|
|
- // There is more than one tbm parameter, which is not expected. Return
|
|
- // kUnknown to signify the result can't be trusted.
|
|
- return GoogleSearchMode::kUnknown;
|
|
- }
|
|
- std::string_view value_str = query_str.substr(value.begin, value.len);
|
|
- if (value_str == "isch") {
|
|
- mode = GoogleSearchMode::kImages;
|
|
- } else if (value_str == "web") {
|
|
- mode = GoogleSearchMode::kWeb;
|
|
- } else if (value_str == "nws") {
|
|
- mode = GoogleSearchMode::kNews;
|
|
- } else if (value_str == "shop") {
|
|
- mode = GoogleSearchMode::kShopping;
|
|
- } else if (value_str == "vid") {
|
|
- mode = GoogleSearchMode::kVideos;
|
|
- } else if (value_str == "bks") {
|
|
- mode = GoogleSearchMode::kBooks;
|
|
- } else if (value_str == "flm") {
|
|
- mode = GoogleSearchMode::kFlights;
|
|
- } else if (value_str == "lcl") {
|
|
- mode = GoogleSearchMode::kLocal;
|
|
- } else {
|
|
- mode = GoogleSearchMode::kUnknown;
|
|
- }
|
|
- }
|
|
- if (mode == GoogleSearchMode::kUnspecified) {
|
|
- // No tbm query parameter means this is the Web mode.
|
|
- mode = GoogleSearchMode::kWeb;
|
|
- }
|
|
- return mode;
|
|
-}
|
|
-
|
|
} // namespace google_util
|
|
diff --git a/components/google/core/common/google_util.h b/components/google/core/common/google_util.h
|
|
--- a/components/google/core/common/google_util.h
|
|
+++ b/components/google/core/common/google_util.h
|
|
@@ -39,7 +39,7 @@ enum class GoogleSearchMode {
|
|
kMaxValue = kFlights,
|
|
};
|
|
|
|
-extern const char kGoogleHomepageURL[];
|
|
+extern const char kGoogleHomepageURL_Checked[];
|
|
|
|
// True iff |str| contains a "q=" or "as_q=" query parameter with a non-empty
|
|
// value. |str| should be a query or a hash fragment, without the ? or # (as
|
|
@@ -132,14 +132,6 @@ bool IsYoutubeDomainUrl(const GURL& url,
|
|
// True if |url| is hosted by Google.
|
|
bool IsGoogleAssociatedDomainUrl(const GURL& url);
|
|
|
|
-// Returns the list of all Google's registerable domains, i.e. domains named
|
|
-// google.<eTLD> owned by Google.
|
|
-// TODO(msramek): This is currently only used to ensure the deletion of Google
|
|
-// service workers on signout. Remove this once we have other options to do it,
|
|
-// such as service workers discovering that signin cookies are missing and
|
|
-// unregistering themselves.
|
|
-const std::vector<std::string>& GetGoogleRegistrableDomains();
|
|
-
|
|
// Appends the provided |key| and |value| pair to the "async" query param list,
|
|
// according to the format used by the Google servers:
|
|
//
|
|
@@ -153,11 +145,6 @@ GURL AppendToAsyncQueryParam(const GURL& url,
|
|
const std::string& key,
|
|
const std::string& value);
|
|
|
|
-// Returns Google Search mode used by the user. This corresponds to the tab
|
|
-// (e.g. web result, image results, video results, etc.) the user is on. This
|
|
-// information is extracted from the "tbm" query parameter on the Search URL.
|
|
-GoogleSearchMode GoogleSearchModeFromUrl(const GURL& url);
|
|
-
|
|
} // namespace google_util
|
|
|
|
#endif // COMPONENTS_GOOGLE_CORE_COMMON_GOOGLE_UTIL_H_
|
|
diff --git a/components/page_load_metrics/browser/page_load_metrics_util.cc b/components/page_load_metrics/browser/page_load_metrics_util.cc
|
|
--- a/components/page_load_metrics/browser/page_load_metrics_util.cc
|
|
+++ b/components/page_load_metrics/browser/page_load_metrics_util.cc
|
|
@@ -303,8 +303,7 @@ bool DidObserveLoadingBehaviorInAnyFrame(
|
|
}
|
|
|
|
bool IsZstdUrl(const GURL& url) {
|
|
- return url.DomainIs("facebook.com") || url.DomainIs("instagram.com") ||
|
|
- url.DomainIs("whatsapp.com") || url.DomainIs("messenger.com");
|
|
+ return false;
|
|
}
|
|
|
|
bool QueryContainsComponent(std::string_view query,
|
|
diff --git a/components/page_load_metrics/google/browser/google_url_util.cc b/components/page_load_metrics/google/browser/google_url_util.cc
|
|
--- a/components/page_load_metrics/google/browser/google_url_util.cc
|
|
+++ b/components/page_load_metrics/google/browser/google_url_util.cc
|
|
@@ -14,6 +14,7 @@
|
|
namespace page_load_metrics {
|
|
|
|
std::optional<std::string> GetGoogleHostnamePrefix(const GURL& url) {
|
|
+ if ((true)) return std::nullopt;
|
|
const size_t registry_length =
|
|
net::registry_controlled_domains::GetRegistryLength(
|
|
url,
|
|
diff --git a/components/search_engines/search_engine_utils.cc b/components/search_engines/search_engine_utils.cc
|
|
--- a/components/search_engines/search_engine_utils.cc
|
|
+++ b/components/search_engines/search_engine_utils.cc
|
|
@@ -26,6 +26,7 @@ bool SameDomain(const GURL& given_url, const GURL& prepopulated_url) {
|
|
|
|
SearchEngineType GetEngineType(const GURL& url) {
|
|
DCHECK(url.is_valid());
|
|
+ if ((true)) return SEARCH_ENGINE_OTHER;
|
|
|
|
// Check using TLD+1s, in order to more aggressively match search engine types
|
|
// for data imported from other browsers.
|
|
diff --git a/components/search_engines/search_terms_data.cc b/components/search_engines/search_terms_data.cc
|
|
--- a/components/search_engines/search_terms_data.cc
|
|
+++ b/components/search_engines/search_terms_data.cc
|
|
@@ -107,7 +107,7 @@ SearchTermsData::SearchTermsData() = default;
|
|
SearchTermsData::~SearchTermsData() = default;
|
|
|
|
std::string SearchTermsData::GoogleBaseURLValue() const {
|
|
- return google_util::kGoogleHomepageURL;
|
|
+ return google_util::kGoogleHomepageURL_Checked;
|
|
}
|
|
|
|
std::string SearchTermsData::GoogleBaseSearchByImageURLValue() const {
|
|
@@ -119,7 +119,7 @@ std::string SearchTermsData::GoogleBaseSearchByImageURLValue() const {
|
|
}
|
|
#endif // !BUILDFLAG(IS_IOS) && !BUILDFLAG(IS_ANDROID)
|
|
|
|
- return google_util::kGoogleHomepageURL + kGoogleHomepageURLPath;
|
|
+ return google_util::kGoogleHomepageURL_Checked + kGoogleHomepageURLPath;
|
|
}
|
|
|
|
std::string SearchTermsData::GoogleBaseSuggestURLValue() const {
|
|
diff --git a/components/search_engines/template_url.cc b/components/search_engines/template_url.cc
|
|
--- a/components/search_engines/template_url.cc
|
|
+++ b/components/search_engines/template_url.cc
|
|
@@ -614,11 +614,7 @@ std::u16string TemplateURLRef::SearchTermToString16(
|
|
|
|
bool TemplateURLRef::HasGoogleBaseURLs(
|
|
const SearchTermsData& search_terms_data) const {
|
|
- ParseIfNecessary(search_terms_data);
|
|
- return std::ranges::any_of(replacements_, [](const Replacement& replacement) {
|
|
- return replacement.type == GOOGLE_BASE_URL ||
|
|
- replacement.type == GOOGLE_BASE_SUGGEST_URL;
|
|
- });
|
|
+ return false;
|
|
}
|
|
|
|
bool TemplateURLRef::ExtractSearchTermsFromURL(
|
|
diff --git a/components/search_provider_logos/BUILD.gn b/components/search_provider_logos/BUILD.gn
|
|
--- a/components/search_provider_logos/BUILD.gn
|
|
+++ b/components/search_provider_logos/BUILD.gn
|
|
@@ -6,8 +6,6 @@ static_library("search_provider_logos") {
|
|
sources = [
|
|
"fixed_logo_api.cc",
|
|
"fixed_logo_api.h",
|
|
- "google_logo_api.cc",
|
|
- "google_logo_api.h",
|
|
"logo_cache.cc",
|
|
"logo_cache.h",
|
|
"logo_common.cc",
|
|
diff --git a/components/search_provider_logos/logo_service_impl.cc b/components/search_provider_logos/logo_service_impl.cc
|
|
--- a/components/search_provider_logos/logo_service_impl.cc
|
|
+++ b/components/search_provider_logos/logo_service_impl.cc
|
|
@@ -246,8 +246,7 @@ void LogoServiceImpl::GetLogo(LogoCallbacks callbacks, bool for_webui_ntp) {
|
|
|
|
GURL base_url;
|
|
GURL doodle_url;
|
|
- const bool is_google = template_url->url_ref().HasGoogleBaseURLs(
|
|
- template_url_service_->search_terms_data());
|
|
+ const bool is_google = false;
|
|
if (is_google) {
|
|
// Note: Ideally the Google doodle URL would be specified in
|
|
// prepopulated_engines.json, but there is some custom logic in
|
|
@@ -274,23 +273,12 @@ void LogoServiceImpl::GetLogo(LogoCallbacks callbacks, bool for_webui_ntp) {
|
|
clock_ = base::DefaultClock::GetInstance();
|
|
}
|
|
|
|
- const bool use_fixed_logo = !doodle_url.is_valid();
|
|
+ const bool use_fixed_logo = true;
|
|
if (use_fixed_logo) {
|
|
SetServerAPI(
|
|
logo_url,
|
|
base::BindRepeating(&search_provider_logos::ParseFixedLogoResponse),
|
|
base::BindRepeating(&search_provider_logos::UseFixedLogoUrl));
|
|
- } else {
|
|
- // We encode the type of doodle (regular or gray) in the URL so that the
|
|
- // logo cache gets cleared when that value changes.
|
|
- GURL prefilled_url = AppendPreliminaryParamsToDoodleURL(
|
|
- want_gray_logo_getter_.Run(), for_webui_ntp, doodle_url);
|
|
- SetServerAPI(
|
|
- prefilled_url,
|
|
- base::BindRepeating(&search_provider_logos::ParseDoodleLogoResponse,
|
|
- base_url),
|
|
- base::BindRepeating(
|
|
- &search_provider_logos::AppendFingerprintParamToDoodleURL));
|
|
}
|
|
|
|
DCHECK(!logo_url_.is_empty());
|
|
diff --git a/components/url_matcher/url_util.cc b/components/url_matcher/url_util.cc
|
|
--- a/components/url_matcher/url_util.cc
|
|
+++ b/components/url_matcher/url_util.cc
|
|
@@ -42,27 +42,15 @@ namespace {
|
|
// Host/regex pattern for Google AMP Cache URLs.
|
|
// See https://developers.google.com/amp/cache/overview#amp-cache-url-format
|
|
// for a definition of the format of AMP Cache URLs.
|
|
-const char kGoogleAmpCacheHost[] = "cdn.ampproject.org";
|
|
const char kGoogleAmpCachePathPattern[] = "/[a-z]/(s/)?(.*)";
|
|
|
|
// Regex pattern for the path of Google AMP Viewer URLs.
|
|
const char kGoogleAmpViewerPathPattern[] = "/amp/(s/)?(.*)";
|
|
|
|
// Host, path prefix, and query regex pattern for Google web cache URLs.
|
|
-const char kGoogleWebCacheHost[] = "webcache.googleusercontent.com";
|
|
-const char kGoogleWebCachePathPrefix[] = "/search";
|
|
const char kGoogleWebCacheQueryPattern[] =
|
|
"cache:(.{12}:)?(https?://)?([^ :]*)( [^:]*)?";
|
|
|
|
-const char kGoogleTranslateSubdomain[] = "translate.";
|
|
-const char kAlternateGoogleTranslateHost[] = "translate.googleusercontent.com";
|
|
-
|
|
-// Returns a full URL using either "http" or "https" as the scheme.
|
|
-GURL BuildURL(bool is_https, const std::string& host_and_path) {
|
|
- std::string scheme = is_https ? url::kHttpsScheme : url::kHttpScheme;
|
|
- return GURL(scheme + "://" + host_and_path);
|
|
-}
|
|
-
|
|
void ProcessQueryToConditions(
|
|
url_matcher::URLMatcherConditionFactory* condition_factory,
|
|
const std::string& query,
|
|
@@ -120,87 +108,10 @@ class EmbeddedURLExtractor {
|
|
|
|
// Implements url_filter::GetEmbeddedURL().
|
|
GURL GetEmbeddedURL(const GURL& url) {
|
|
- // Check for "*.cdn.ampproject.org" URLs.
|
|
- if (url.DomainIs(kGoogleAmpCacheHost)) {
|
|
- std::string s;
|
|
- std::string embedded;
|
|
- if (re2::RE2::FullMatch(url.path(), google_amp_cache_path_regex_, &s,
|
|
- &embedded)) {
|
|
- if (url.has_query())
|
|
- embedded += "?" + url.query();
|
|
- return BuildURL(!s.empty(), embedded);
|
|
- }
|
|
- }
|
|
-
|
|
- // Check for "www.google.TLD/amp/" URLs.
|
|
- if (GURL google_amp_embedded_url = GetGoogleAmpViewerEmbeddedURL(url);
|
|
- !google_amp_embedded_url.is_empty()) {
|
|
- return google_amp_embedded_url;
|
|
- }
|
|
-
|
|
- // Check for Google web cache URLs
|
|
- // ("webcache.googleusercontent.com/search?q=cache:...").
|
|
- std::string query;
|
|
- if (url.host_piece() == kGoogleWebCacheHost &&
|
|
- base::StartsWith(url.path_piece(), kGoogleWebCachePathPrefix) &&
|
|
- net::GetValueForKeyInQuery(url, "q", &query)) {
|
|
- std::string fingerprint;
|
|
- std::string scheme;
|
|
- std::string embedded;
|
|
- if (re2::RE2::FullMatch(query, google_web_cache_query_regex_,
|
|
- &fingerprint, &scheme, &embedded)) {
|
|
- return BuildURL(scheme == "https://", embedded);
|
|
- }
|
|
- }
|
|
-
|
|
- // Check for Google translate URLs ("translate.google.TLD/...?...&u=URL" or
|
|
- // "translate.googleusercontent.com/...?...&u=URL").
|
|
- bool is_translate = false;
|
|
- if (base::StartsWith(url.host_piece(), kGoogleTranslateSubdomain)) {
|
|
- // Remove the "translate." prefix.
|
|
- GURL::Replacements replace;
|
|
- replace.SetHostStr(
|
|
- url.host_piece().substr(strlen(kGoogleTranslateSubdomain)));
|
|
- GURL trimmed = url.ReplaceComponents(replace);
|
|
- // Check that the remainder is a Google URL. Note: IsGoogleDomainUrl
|
|
- // checks for [www.]google.TLD, but we don't want the "www.", so
|
|
- // explicitly exclude that.
|
|
- // TODO(treib,pam): Instead of excluding "www." manually, teach
|
|
- // IsGoogleDomainUrl a mode that doesn't allow it.
|
|
- is_translate = google_util::IsGoogleDomainUrl(
|
|
- trimmed, google_util::DISALLOW_SUBDOMAIN,
|
|
- google_util::DISALLOW_NON_STANDARD_PORTS) &&
|
|
- !base::StartsWith(trimmed.host_piece(), "www.");
|
|
- }
|
|
- bool is_alternate_translate =
|
|
- url.host_piece() == kAlternateGoogleTranslateHost;
|
|
- if (is_translate || is_alternate_translate) {
|
|
- std::string embedded;
|
|
- if (net::GetValueForKeyInQuery(url, "u", &embedded)) {
|
|
- // The embedded URL may or may not include a scheme. Fix it if
|
|
- // necessary.
|
|
- return url_formatter::FixupURL(embedded, /*desired_tld=*/std::string());
|
|
- }
|
|
- }
|
|
-
|
|
return GURL();
|
|
}
|
|
|
|
GURL GetGoogleAmpViewerEmbeddedURL(const GURL& url) const {
|
|
- // Check for "www.google.TLD/amp/" URLs.
|
|
- if (google_util::IsGoogleDomainUrl(
|
|
- url, google_util::DISALLOW_SUBDOMAIN,
|
|
- google_util::DISALLOW_NON_STANDARD_PORTS)) {
|
|
- std::string s;
|
|
- std::string embedded;
|
|
- if (re2::RE2::FullMatch(url.path(), google_amp_viewer_path_regex_, &s,
|
|
- &embedded)) {
|
|
- // The embedded URL may be percent-encoded. Undo that.
|
|
- embedded = base::UnescapeBinaryURLComponent(embedded);
|
|
- return BuildURL(!s.empty(), embedded);
|
|
- }
|
|
- }
|
|
-
|
|
return GURL();
|
|
}
|
|
|
|
diff --git a/content/common/webid/identity_url_loader_throttle.cc b/content/common/webid/identity_url_loader_throttle.cc
|
|
--- a/content/common/webid/identity_url_loader_throttle.cc
|
|
+++ b/content/common/webid/identity_url_loader_throttle.cc
|
|
@@ -36,6 +36,7 @@ namespace content {
|
|
|
|
std::unique_ptr<blink::URLLoaderThrottle> MaybeCreateIdentityUrlLoaderThrottle(
|
|
SetIdpStatusCallback cb) {
|
|
+ if ((true)) return nullptr;
|
|
return std::make_unique<IdentityUrlLoaderThrottle>(std::move(cb));
|
|
}
|
|
|
|
diff --git a/cromite_flags/content/public/common/content_features_cc/ungoogled-chromium-no-special-hosts-domains.inc b/cromite_flags/content/public/common/content_features_cc/ungoogled-chromium-no-special-hosts-domains.inc
|
|
new file mode 100644
|
|
--- /dev/null
|
|
+++ b/cromite_flags/content/public/common/content_features_cc/ungoogled-chromium-no-special-hosts-domains.inc
|
|
@@ -0,0 +1 @@
|
|
+// none
|
|
diff --git a/net/base/url_util.cc b/net/base/url_util.cc
|
|
--- a/net/base/url_util.cc
|
|
+++ b/net/base/url_util.cc
|
|
@@ -519,34 +519,11 @@ bool HasGoogleHost(const GURL& url) {
|
|
}
|
|
|
|
bool IsGoogleHost(std::string_view host) {
|
|
- static const char* kGoogleHostSuffixes[] = {
|
|
- ".google.com",
|
|
- ".youtube.com",
|
|
- ".gmail.com",
|
|
- ".doubleclick.net",
|
|
- ".gstatic.com",
|
|
- ".googlevideo.com",
|
|
- ".googleusercontent.com",
|
|
- ".googlesyndication.com",
|
|
- ".google-analytics.com",
|
|
- ".googleadservices.com",
|
|
- ".googleapis.com",
|
|
- ".ytimg.com",
|
|
- };
|
|
- for (const char* suffix : kGoogleHostSuffixes) {
|
|
- // Here it's possible to get away with faster case-sensitive comparisons
|
|
- // because the list above is all lowercase, and a GURL's host name will
|
|
- // always be canonicalized to lowercase as well.
|
|
- if (host.ends_with(suffix)) {
|
|
- return true;
|
|
- }
|
|
- }
|
|
return false;
|
|
}
|
|
|
|
bool IsGoogleHostWithAlpnH3(std::string_view host) {
|
|
- return base::EqualsCaseInsensitiveASCII(host, "google.com") ||
|
|
- base::EqualsCaseInsensitiveASCII(host, "www.google.com");
|
|
+ return false;
|
|
}
|
|
|
|
bool IsLocalHostname(std::string_view host) {
|
|
diff --git a/services/network/network_context.cc b/services/network/network_context.cc
|
|
--- a/services/network/network_context.cc
|
|
+++ b/services/network/network_context.cc
|
|
@@ -3025,7 +3025,7 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
|
|
}
|
|
#endif // BUILDFLAG(IS_CT_SUPPORTED)
|
|
|
|
- if (params_->enable_domain_reliability) {
|
|
+ if ((false) /*params_->enable_domain_reliability*/) {
|
|
domain_reliability_monitor_ =
|
|
std::make_unique<domain_reliability::DomainReliabilityMonitor>(
|
|
result.url_request_context.get(),
|
|
--
|