2
0
mirror of https://codeberg.org/kiss-community/repo synced 2024-08-22 22:16:19 +00:00
repo/testing/chromium/patches/disable-gaia.patch

139 lines
6.6 KiB
Diff

# Disables Gaia code
# Somehow it is still activated even without being signed-in: https://github.com/Eloston/ungoogled-chromium/issues/104
--- a/google_apis/gaia/gaia_auth_fetcher.cc
+++ b/google_apis/gaia/gaia_auth_fetcher.cc
@@ -262,61 +262,6 @@ void GaiaAuthFetcher::CreateAndStartGaia
int load_flags,
const net::NetworkTrafficAnnotationTag& traffic_annotation) {
DCHECK(!fetch_pending_) << "Tried to fetch two things at once!";
-
- auto resource_request = std::make_unique<network::ResourceRequest>();
- resource_request->url = gaia_gurl;
- original_url_ = gaia_gurl;
-
- if (!(load_flags & net::LOAD_DO_NOT_SEND_COOKIES)) {
- DCHECK_EQ(GaiaUrls::GetInstance()->gaia_url(), gaia_gurl.GetOrigin())
- << gaia_gurl;
- resource_request->site_for_cookies = GaiaUrls::GetInstance()->gaia_url();
- }
-
- if (!body.empty())
- resource_request->method = "POST";
-
- if (!headers.empty())
- resource_request->headers.AddHeadersFromString(headers);
-
- // The Gaia token exchange requests do not require any cookie-based
- // identification as part of requests. We suppress sending any cookies to
- // maintain a separation between the user's browsing and Chrome's internal
- // services. Where such mixing is desired (MergeSession or OAuthLogin), it
- // will be done explicitly.
- resource_request->load_flags = load_flags;
-
- // Use raw headers as the cookies are filtered-out of the response when
- // serialized at the IPC layer.
- resource_request->report_raw_headers = true;
-
- url_loader_ = network::SimpleURLLoader::Create(std::move(resource_request),
- traffic_annotation);
- if (!body.empty())
- url_loader_->AttachStringForUpload(body,
- "application/x-www-form-urlencoded");
-
- url_loader_->SetAllowHttpErrorResults(true);
-
- VLOG(2) << "Gaia fetcher URL: " << gaia_gurl.spec();
- VLOG(2) << "Gaia fetcher headers: " << headers;
- VLOG(2) << "Gaia fetcher body: " << body;
-
- // Fetchers are sometimes cancelled because a network change was detected,
- // especially at startup and after sign-in on ChromeOS. Retrying once should
- // be enough in those cases; let the fetcher retry up to 3 times just in case.
- // http://crbug.com/163710
- url_loader_->SetRetryOptions(
- 3, network::SimpleURLLoader::RETRY_ON_NETWORK_CHANGE);
-
- fetch_pending_ = true;
-
- // Unretained is OK below as |url_loader_| is owned by this.
- url_loader_->DownloadToString(
- url_loader_factory_.get(),
- base::BindOnce(&GaiaAuthFetcher::OnURLLoadComplete,
- base::Unretained(this)),
- kMaxMessageSize);
}
// static
--- a/chrome/browser/resources/component_extension_resources.grd
+++ b/chrome/browser/resources/component_extension_resources.grd
@@ -32,8 +32,6 @@
<!-- Bookmarks -->
<include name="IDR_COMPONENT_BOOKMARKS_BOOKMARKS_HTML" file="bookmarks/bookmarks.html" type="BINDATA" />
- <!-- Gaia auth extension -->
- <include name="IDR_GAIA_AUTH_SUCCESS" file="gaia_auth/success.html" allowexternalscript="true" type="BINDATA" />
<!-- Hangout Services extension, included in Google Chrome builds only. -->
<if expr="_google_chrome or enable_hangout_services_extension">
<include name="IDR_HANGOUT_SERVICES_BACKGROUND_HTML" file="hangout_services/background.html" type="BINDATA" />
--- a/chrome/browser/extensions/signin/gaia_auth_extension_loader.cc
+++ b/chrome/browser/extensions/signin/gaia_auth_extension_loader.cc
@@ -43,19 +43,6 @@ ComponentLoader* GetComponentLoader(Brow
void LoadGaiaAuthExtension(BrowserContext* context) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
-
- ComponentLoader* component_loader = GetComponentLoader(context);
- const base::CommandLine* command_line =
- base::CommandLine::ForCurrentProcess();
- if (command_line->HasSwitch(::switches::kAuthExtensionPath)) {
- base::FilePath auth_extension_path =
- command_line->GetSwitchValuePath(::switches::kAuthExtensionPath);
- component_loader->Add(IDR_GAIA_AUTH_MANIFEST, auth_extension_path);
- return;
- }
-
- component_loader->Add(IDR_GAIA_AUTH_MANIFEST,
- base::FilePath(FILE_PATH_LITERAL("gaia_auth")));
}
void UnloadGaiaAuthExtension(BrowserContext* context) {
--- a/chrome/browser/extensions/component_extensions_whitelist/whitelist.cc
+++ b/chrome/browser/extensions/component_extensions_whitelist/whitelist.cc
@@ -67,7 +67,6 @@ bool IsComponentExtensionWhitelisted(int
#endif
case IDR_CRYPTOTOKEN_MANIFEST:
case IDR_FEEDBACK_MANIFEST:
- case IDR_GAIA_AUTH_MANIFEST:
#if BUILDFLAG(ENABLE_HANGOUT_SERVICES_EXTENSION)
case IDR_HANGOUT_SERVICES_MANIFEST:
#endif
--- a/chrome/browser/ui/webui/signin/inline_login_ui.cc
+++ b/chrome/browser/ui/webui/signin/inline_login_ui.cc
@@ -53,7 +53,6 @@ content::WebUIDataSource* CreateWebUIDat
source->AddResourcePath("inline_login.css", IDR_INLINE_LOGIN_CSS);
source->AddResourcePath("inline_login.js", IDR_INLINE_LOGIN_JS);
- source->AddResourcePath("gaia_auth_host.js", IDR_GAIA_AUTH_AUTHENTICATOR_JS);
source->AddLocalizedString("title", IDS_CHROME_SIGNIN_TITLE);
source->AddLocalizedString(
--- a/chrome/browser/browser_resources.grd
+++ b/chrome/browser/browser_resources.grd
@@ -392,7 +392,6 @@
<include name="IDR_INLINE_LOGIN_HTML" file="resources\inline_login\inline_login.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" />
<include name="IDR_INLINE_LOGIN_CSS" file="resources\inline_login\inline_login.css" flattenhtml="true" type="BINDATA" />
<include name="IDR_INLINE_LOGIN_JS" file="resources\inline_login\inline_login.js" flattenhtml="true" type="BINDATA" />
- <include name="IDR_GAIA_AUTH_AUTHENTICATOR_JS" file="resources\gaia_auth_host\authenticator.js" flattenhtml="true" type="BINDATA" />
<include name="IDR_INSPECT_CSS" file="resources\inspect\inspect.css" flattenhtml="true" type="BINDATA" />
<include name="IDR_INSPECT_HTML" file="resources\inspect\inspect.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" />
<include name="IDR_INSPECT_JS" file="resources\inspect\inspect.js" flattenhtml="true" type="BINDATA" />
@@ -492,7 +491,6 @@
<include name="IDR_WEBRTC_LOGS_JS" file="resources\media\webrtc_logs.js" type="BINDATA" />
<include name="IDR_WEBSTORE_MANIFEST" file="resources\webstore_app\manifest.json" type="BINDATA" />
<include name="IDR_CRYPTOTOKEN_MANIFEST" file="resources\cryptotoken\manifest.json" type="BINDATA" />
- <include name="IDR_GAIA_AUTH_MANIFEST" file="resources\gaia_auth\manifest.json" type="BINDATA" />
<if expr="chromeos">
<if expr="optimize_webui">
<then>