disable-gaia.patch 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. # Disables Gaia code
  2. # Somehow it is still activated even without being signed-in: https://github.com/Eloston/ungoogled-chromium/issues/104
  3. --- a/chrome/browser/browser_resources.grd
  4. +++ b/chrome/browser/browser_resources.grd
  5. @@ -140,7 +140,6 @@
  6. <include name="IDR_INLINE_LOGIN_HTML" file="resources\inline_login\inline_login.html" compress="gzip" flattenhtml="true" allowexternalscript="true" type="BINDATA" preprocess="true" />
  7. <include name="IDR_INLINE_LOGIN_CSS" file="resources\inline_login\inline_login.css" compress="gzip" flattenhtml="true" type="BINDATA" preprocess="true" />
  8. <include name="IDR_INLINE_LOGIN_JS" file="resources\inline_login\inline_login.js" compress="gzip" flattenhtml="true" type="BINDATA" />
  9. - <include name="IDR_GAIA_AUTH_AUTHENTICATOR_JS" file="resources\gaia_auth_host\authenticator.js" compress="gzip" flattenhtml="true" type="BINDATA" />
  10. <include name="IDR_INSPECT_CSS" file="resources\inspect\inspect.css" compress="gzip" flattenhtml="true" type="BINDATA" />
  11. <include name="IDR_INSPECT_HTML" file="resources\inspect\inspect.html" compress="gzip" flattenhtml="true" allowexternalscript="true" type="BINDATA" />
  12. --- a/chrome/browser/ui/webui/signin/inline_login_ui.cc
  13. +++ b/chrome/browser/ui/webui/signin/inline_login_ui.cc
  14. @@ -120,7 +120,6 @@ content::WebUIDataSource* CreateWebUIDat
  15. source->AddResourcePath("inline_login.css", IDR_INLINE_LOGIN_CSS);
  16. source->AddResourcePath("inline_login.js", IDR_INLINE_LOGIN_JS);
  17. - source->AddResourcePath("gaia_auth_host.js", IDR_GAIA_AUTH_AUTHENTICATOR_JS);
  18. #if defined(OS_CHROMEOS)
  19. source->OverrideContentSecurityPolicyScriptSrc(
  20. --- a/google_apis/gaia/gaia_auth_fetcher.cc
  21. +++ b/google_apis/gaia/gaia_auth_fetcher.cc
  22. @@ -293,65 +293,6 @@ void GaiaAuthFetcher::CreateAndStartGaia
  23. network::mojom::CredentialsMode credentials_mode,
  24. const net::NetworkTrafficAnnotationTag& traffic_annotation) {
  25. DCHECK(!fetch_pending_) << "Tried to fetch two things at once!";
  26. -
  27. - auto resource_request = std::make_unique<network::ResourceRequest>();
  28. - resource_request->url = gaia_gurl;
  29. - original_url_ = gaia_gurl;
  30. -
  31. - if (credentials_mode != network::mojom::CredentialsMode::kOmit) {
  32. - DCHECK_EQ(GaiaUrls::GetInstance()->gaia_url(), gaia_gurl.GetOrigin())
  33. - << gaia_gurl;
  34. - url::Origin origin =
  35. - url::Origin::Create(GaiaUrls::GetInstance()->gaia_url());
  36. - resource_request->site_for_cookies =
  37. - net::SiteForCookies::FromOrigin(origin);
  38. - resource_request->trusted_params =
  39. - network::ResourceRequest::TrustedParams();
  40. - resource_request->trusted_params->network_isolation_key =
  41. - net::NetworkIsolationKey(origin, origin);
  42. - }
  43. -
  44. - if (!body.empty())
  45. - resource_request->method = "POST";
  46. -
  47. - if (!headers.empty())
  48. - resource_request->headers.AddHeadersFromString(headers);
  49. -
  50. - // The Gaia token exchange requests do not require any cookie-based
  51. - // identification as part of requests. We suppress sending any cookies to
  52. - // maintain a separation between the user's browsing and Chrome's internal
  53. - // services. Where such mixing is desired (MergeSession or OAuthLogin), it
  54. - // will be done explicitly.
  55. - resource_request->credentials_mode = credentials_mode;
  56. -
  57. - url_loader_ = network::SimpleURLLoader::Create(std::move(resource_request),
  58. - traffic_annotation);
  59. - if (!body.empty()) {
  60. - DCHECK(!body_content_type.empty());
  61. - url_loader_->AttachStringForUpload(body, body_content_type);
  62. - }
  63. -
  64. - url_loader_->SetAllowHttpErrorResults(true);
  65. -
  66. - VLOG(2) << "Gaia fetcher URL: " << gaia_gurl.spec();
  67. - VLOG(2) << "Gaia fetcher headers: " << headers;
  68. - VLOG(2) << "Gaia fetcher body: " << body;
  69. -
  70. - // Fetchers are sometimes cancelled because a network change was detected,
  71. - // especially at startup and after sign-in on ChromeOS. Retrying once should
  72. - // be enough in those cases; let the fetcher retry up to 3 times just in case.
  73. - // http://crbug.com/163710
  74. - url_loader_->SetRetryOptions(
  75. - 3, network::SimpleURLLoader::RETRY_ON_NETWORK_CHANGE);
  76. -
  77. - fetch_pending_ = true;
  78. -
  79. - // Unretained is OK below as |url_loader_| is owned by this.
  80. - url_loader_->DownloadToString(
  81. - url_loader_factory_.get(),
  82. - base::BindOnce(&GaiaAuthFetcher::OnURLLoadComplete,
  83. - base::Unretained(this)),
  84. - kMaxMessageSize);
  85. }
  86. // static