mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
* chore: bump chromium in DEPS to 147.0.7693.0 * chore: bump chromium in DEPS to 147.0.7694.0 * chore: bump chromium in DEPS to 147.0.7695.0 * chore: bump chromium in DEPS to 147.0.7697.0 * chore: bump chromium in DEPS to 147.0.7698.0 * fix(patch): IsGuest moved to SecurityPrincipal Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7234613 Co-Authored-By: Claude (claude-opus-4-6) * chore: update patches (trivial only) * fix(patch): v8::External API now requires ExternalPointerTypeTag Ref: https://chromium-review.googlesource.com/c/v8/v8/+/7562476 Co-Authored-By: Claude (claude-opus-4-6) * fix: update CreateCustomWebContents signature Upstream added disposition and window_features parameters. Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7585256 Co-Authored-By: Claude (claude-opus-4-6) * fix: OriginatingProcess renamed to OriginatingProcessId Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7557820 Co-Authored-By: Claude (claude-opus-4-6) * fix: kLogNetLog moved from network::switches to net::switches Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7559090 Co-Authored-By: Claude (claude-opus-4-6) * fix(patch): patch out glic and save-to-drive Profile usage in PDF Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7589312 Co-Authored-By: Claude (claude-opus-4-6) * chore: bump chromium in DEPS to 147.0.7699.0 * chore: remove upstreamed pseudonymization salt descriptor code Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7568382 Co-Authored-By: Claude (claude-opus-4-6) * chore: update patches (trivial only) * chore: update reclient patch format (copy-from to new-file) Co-Authored-By: Claude (claude-opus-4-6) * chore: remove upstreamed patch and update stale patches Co-Authored-By: Claude (claude-opus-4-6) * fix: expose GetLibGdk3 and guard glic function body GetLibGdk3 needs to be public for Electron's gdk_display_beep usage. ShouldShowGlicSummarizeButton body must be guarded, not just call site. Co-Authored-By: Claude (claude-opus-4-6) * fix(patch): v8::External API in nan requires ExternalPointerTypeTag Ref: https://chromium-review.googlesource.com/c/v8/v8/+/7562476 Co-Authored-By: Claude (claude-opus-4-6) * fixup fix(patch): v8::External API in nan requires ExternalPointerTypeTag * fixup: remove extraneous changes to patches Caused bydebb3716816e51034728* fixup: revert fix: expose GetLibGdk3 and guard glic function body Reverts6e51034728as this was an unneeded changed caused by the incorrect changes made indebb371681* 7586673: Update logic for showing pdf summarize button 7586673: Update logic for showing pdf summarize button | https://chromium-review.googlesource.com/c/chromium/src/+/7586673 Also 7454131: set enable_glic=true | https://chromium-review.googlesource.com/c/chromium/src/+/7454131 (landed in previous roll) --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Alice Zhao <alicelovescake@anthropic.com> Co-authored-by: John Kleinschmidt <kleinschmidtorama@gmail.com>
91 lines
4.3 KiB
Diff
91 lines
4.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Jeremy Apthorp <nornagon@nornagon.net>
|
|
Date: Wed, 28 Aug 2019 12:21:25 -0700
|
|
Subject: expose SetUserAgent on NetworkContext
|
|
|
|
Applying
|
|
https://chromium-review.googlesource.com/c/chromium/src/+/1585083 before
|
|
it's merged. There may end up being a better way of doing this, or the
|
|
patch may be merged upstream, at which point this patch should be
|
|
removed.
|
|
|
|
diff --git a/net/url_request/static_http_user_agent_settings.h b/net/url_request/static_http_user_agent_settings.h
|
|
index 0ab8187b0db8ae6db46d81738f653a2bc4c566f6..de3d55e85c22317f7f9375eb94d0d5d41b0dbd3b 100644
|
|
--- a/net/url_request/static_http_user_agent_settings.h
|
|
+++ b/net/url_request/static_http_user_agent_settings.h
|
|
@@ -30,13 +30,17 @@ class NET_EXPORT StaticHttpUserAgentSettings : public HttpUserAgentSettings {
|
|
accept_language_ = new_accept_language;
|
|
}
|
|
|
|
+ void set_user_agent(const std::string& new_user_agent) {
|
|
+ user_agent_ = new_user_agent;
|
|
+ }
|
|
+
|
|
// HttpUserAgentSettings implementation
|
|
std::string GetAcceptLanguage() const override;
|
|
std::string GetUserAgent() const override;
|
|
|
|
private:
|
|
std::string accept_language_;
|
|
- const std::string user_agent_;
|
|
+ std::string user_agent_;
|
|
};
|
|
|
|
} // namespace net
|
|
diff --git a/services/network/network_context.cc b/services/network/network_context.cc
|
|
index 24bf1331876ae80b7d0b9a88876d83922a446a85..6318cb88a4a5bb8c74d9c66e91ee95ca20594a4a 100644
|
|
--- a/services/network/network_context.cc
|
|
+++ b/services/network/network_context.cc
|
|
@@ -1880,6 +1880,13 @@ void NetworkContext::SetNetworkConditions(
|
|
std::move(network_conditions));
|
|
}
|
|
|
|
+void NetworkContext::SetUserAgent(const std::string& new_user_agent) {
|
|
+ // This may only be called on NetworkContexts created with a constructor that
|
|
+ // calls ApplyContextParamsToBuilder.
|
|
+ DCHECK(user_agent_settings_);
|
|
+ user_agent_settings_->set_user_agent(new_user_agent);
|
|
+}
|
|
+
|
|
void NetworkContext::SetAcceptLanguage(const std::string& new_accept_language) {
|
|
// This may only be called on NetworkContexts created with the constructor
|
|
// that calls MakeURLRequestContext().
|
|
diff --git a/services/network/network_context.h b/services/network/network_context.h
|
|
index ea1941500a0036d5d9ab81be113f67e79bb7e96a..5c81de1cc186c16d92c4ffb4aeaa5d99edae2287 100644
|
|
--- a/services/network/network_context.h
|
|
+++ b/services/network/network_context.h
|
|
@@ -321,6 +321,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
|
|
void SetNetworkConditions(
|
|
const base::UnguessableToken& throttling_profile_id,
|
|
std::vector<mojom::MatchedNetworkConditionsPtr> conditions) override;
|
|
+ void SetUserAgent(const std::string& new_user_agent) override;
|
|
void SetAcceptLanguage(const std::string& new_accept_language) override;
|
|
void SetEnableReferrers(bool enable_referrers) override;
|
|
#if BUILDFLAG(IS_CT_SUPPORTED)
|
|
diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
|
|
index 3ae721ad0d982d64f0531d9a0b94ff7062a2865a..ba76f74b352c677352eed38c027ab46e4d5452dd 100644
|
|
--- a/services/network/public/mojom/network_context.mojom
|
|
+++ b/services/network/public/mojom/network_context.mojom
|
|
@@ -1276,6 +1276,9 @@ interface NetworkContext {
|
|
SetNetworkConditions(mojo_base.mojom.UnguessableToken throttling_profile_id,
|
|
array<MatchedNetworkConditions> conditions);
|
|
|
|
+ // Updates the user agent to be used for requests.
|
|
+ SetUserAgent(string new_user_agent);
|
|
+
|
|
// Updates the Accept-Language header to be used for requests.
|
|
SetAcceptLanguage(string new_accept_language);
|
|
|
|
diff --git a/services/network/test/test_network_context.h b/services/network/test/test_network_context.h
|
|
index d08e0914da4e53b1cf0f2de8c067a4aed634a474..80af85c3ed86155b7fe25bb00546946d4696eee3 100644
|
|
--- a/services/network/test/test_network_context.h
|
|
+++ b/services/network/test/test_network_context.h
|
|
@@ -156,6 +156,7 @@ class TestNetworkContext : public mojom::NetworkContext {
|
|
void SetNetworkConditions(
|
|
const base::UnguessableToken& throttling_profile_id,
|
|
std::vector<mojom::MatchedNetworkConditionsPtr>) override {}
|
|
+ void SetUserAgent(const std::string& new_user_agent) override {}
|
|
void SetAcceptLanguage(const std::string& new_accept_language) override {}
|
|
void SetEnableReferrers(bool enable_referrers) override {}
|
|
#if BUILDFLAG(IS_CT_SUPPORTED)
|