mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
chore: bump chromium to 85.0.4181.1 (10-x-y) (#23987)
* chore: bump chromium in DEPS to 85.0.4165.1 * chore: bump chromium in DEPS to 85.0.4166.1 * chore: bump chromium in DEPS to 85.0.4166.2 * chore: bump chromium in DEPS to 85.0.4166.3 * update patches * fixup! Revert "[printing] Mojofy PrintHostMsg_CheckForCancel" (cherry picked from commit 2cc1caf5d7d716ceefb23d5228a79544a2e91206) * update patches * Revert "[printing] Mojofy PrintHostMsg_CheckForCancel" (cherry picked from commit c2b389957836ad77eb8e977872e6a8590666f3da) * Remove WebImeTextSpan https://chromium-review.googlesource.com/c/chromium/src/+/2225240 (cherry picked from commit d839261d71b156c972d3878f16f971e6b6d98f45) * Remove PDFAnnotations flag altogether. https://chromium-review.googlesource.com/c/chromium/src/+/2229317 (cherry picked from commit 50384ed12602d4a9da3209eacfca4faae78f9986) * Rework find-from-selection so it's synchronous -- fixes flaky tests https://chromium-review.googlesource.com/c/chromium/src/+/2181570 (cherry picked from commit 3e9241560390fb18969393beda425afc63f5a151) * Use ExtensionSystem::is_ready() instead of ExtensionService::is_ready() https://chromium-review.googlesource.com/c/chromium/src/+/2207499 (cherry picked from commit 2424589454a9a2ef9cc89c232b4ee87b0bf400cc) * update sysroots (cherry picked from commit b5ea653e602152dde00303d1cfb915d4df320983) * chore: bump chromium in DEPS to 85.0.4167.1 * Take RFH as a parameter for DidUpdateFavicon/ManifestURL https://chromium-review.googlesource.com/c/chromium/src/+/2224745 (cherry picked from commit ad40668221732e28bcc8b9b270ab4686c42e956a) * update patches * update patches * Rename net::cookie_util::StripStatuses to StripAccessResults https://chromium-review.googlesource.com/c/chromium/src/+/2212697 (cherry picked from commit bf3de1fe1cbb17feb46b40c81f0eb13b1e7b6412) * use net::CookieAccessResultList instead of net::CookieAccessResultList (cherry picked from commit 400da79504da2310b7c1177b4b3f9f83a3f2b305) * chore: bump chromium in DEPS to 85.0.4168.1 * fix mas_no_private_api patch https://chromium-review.googlesource.com/c/chromium/src/+/2230281 (cherry picked from commit 9b127147e0ba7ef1d4454099effe49327b1a5ab6) * Update patches * fix: add new navigation state REUSE_SITE_INSTANCE To fix the new set of state checks added in https://chromium-review.googlesource.com/c/chromium/src/+/2215141 (cherry picked from commit 3a91b684efdc7742e7c5efa65263f80e8a24ec4a) * chore: bump chromium in DEPS to 85.0.4169.1 * update patches * chore: bump chromium in DEPS to 85.0.4170.1 * chore: bump chromium in DEPS to 85.0.4171.1 * chore: bump chromium in DEPS to 85.0.4172.1 * chore: bump chromium in DEPS to 85.0.4173.1 * chore: bump chromium in DEPS to 85.0.4174.1 * chore: bump chromium in DEPS to 85.0.4175.3 * chore: bump chromium in DEPS to 85.0.4176.1 * chore: bump chromium in DEPS to 85.0.4177.2 * chore: bump chromium in DEPS to 85.0.4178.1 * chore: bump chromium in DEPS to 85.0.4178.3 * refactor: MessageLoop, you are terminated \o/ Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2246173 (cherry picked from commit0368131d60) * chore: bump chromium in DEPS to 85.0.4178.4 * update patches * update lib_src_switch_buffer_kmaxlength_to_size_t.patch (cherry picked from commitc5efbdd166) * [v8] Allow for 4GB TypedArrays https: //chromium-review.googlesource.com/c/v8/v8/+/2249668 (cherry picked from commit2c1d6bfd9d) Co-Authored-By: Robo <hop2deep@gmail.com> * Cleanup usages of old mojo types and remove unused code https://chromium-review.googlesource.com/c/chromium/src/+/2235699 (cherry picked from commite89cb21e8e) * refactor: plumb DownloadSchedule to DownloadItem Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2242202 (cherry picked from commit4d549ae2b0) * chore: fix variable typo in IPC (cherry picked from commit7251b1e6c5) * chore: s/BindPipeAndPassReceiver/BindNewPipeAndPassReceiver (cherry picked from commite89bd6c639) * chore: XEvent becomes x11::Event Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2240355 (cherry picked from commit4d832da740) * fixup! refactor: MessageLoop, you are terminated \o/ (cherry picked from commit902d72d740) * fixup! chore: XEvent becomes x11::Event (cherry picked from commit27043549f3) * chore: fix windows build (cherry picked from commit4977098eb3) * chore: disable SameSite-by-default changes https://chromium-review.googlesource.com/c/chromium/src/+/2231445 (cherry picked from commitd8318aafff) * update printing.patch (cherry picked from commite2037f527f) * Convert WidgetHostMsg_SelectionBoundsChanged/TextInputStateChanged https://chromium-review.googlesource.com/c/chromium/src/+/2243531 (cherry picked from commit60ff2e067d) * [XProto] Replace usages of XID and ::Window with x11::Window https://chromium-review.googlesource.com/c/chromium/src/+/2249389 (cherry picked from commit97f5b59e06) * Update VideoFrameMetadata to use base::Optionals https://chromium-review.googlesource.com/c/chromium/src/+/2231706 https://chromium-review.googlesource.com/c/chromium/src/+/2238361 (cherry picked from commit4787e1f541) * --disable-dev-shm-usage for gpu process crash (cherry picked from commit207d8a380a) * update patches * fixup: Cleanup usages of old mojo types and remove unused code * update patches * chore: bump chromium in DEPS to 85.0.4180.1 * build: update v8 headers (cherry picked from commit4808975f75) * Update patches * fixup: build: update v8 headers * Fixup ssl_security_state_tab_helper.patch * Add missing headers * Adds icon loading service with sandbox for Windows. https://chromium-review.googlesource.com/c/chromium/src/+/1987273 * disable app.getGPUInfo spec on linux (cherry picked from commitb7ea16c4b7) * Add missing headers for Linux and Windows * Fixup Adds icon loading service with sandbox for Windows * chore: bump chromium in DEPS to 85.0.4181.1 * update patches * Fixup: (for real) Adds icon loading service with sandbox for Windows * No more Vulkan info collection for UMA on Windows https://chromium-review.googlesource.com/c/chromium/src/+/2252818 * extensions: Rename SharedUserScriptMaster to SharedUserScriptManager https://chromium-review.googlesource.com/c/chromium/src/+/2258357 * Add missing headers * fixup: extensions: Rename SharedUserScriptMaster to SharedUserScriptManager * fixup: No more Vulkan info collection for UMA on Windows * Add missing header * Add resource for IDS_UTILITY_PROCESS_UTILITY_WIN_NAME * fix build on windows * fix gn check Co-authored-by: John Kleinschmidt <jkleinsc@github.com> Co-authored-by: deepak1556 <hop2deep@gmail.com> Co-authored-by: Electron Bot <anonymous@electronjs.org> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
This commit is contained in:
@@ -152,12 +152,13 @@ void FilterCookies(const base::Value& filter,
|
||||
promise.Resolve(result);
|
||||
}
|
||||
|
||||
void FilterCookieWithStatuses(const base::Value& filter,
|
||||
gin_helper::Promise<net::CookieList> promise,
|
||||
const net::CookieStatusList& list,
|
||||
const net::CookieStatusList& excluded_list) {
|
||||
void FilterCookieWithStatuses(
|
||||
const base::Value& filter,
|
||||
gin_helper::Promise<net::CookieList> promise,
|
||||
const net::CookieAccessResultList& list,
|
||||
const net::CookieAccessResultList& excluded_list) {
|
||||
FilterCookies(filter, std::move(promise),
|
||||
net::cookie_util::StripStatuses(list));
|
||||
net::cookie_util::StripAccessResults(list));
|
||||
}
|
||||
|
||||
// Parse dictionary property to CanonicalCookie time correctly.
|
||||
|
||||
@@ -52,6 +52,8 @@
|
||||
#include "gin/object_template_builder.h"
|
||||
#include "gin/wrappable.h"
|
||||
#include "mojo/public/cpp/bindings/associated_remote.h"
|
||||
#include "mojo/public/cpp/bindings/pending_receiver.h"
|
||||
#include "mojo/public/cpp/bindings/remote.h"
|
||||
#include "mojo/public/cpp/system/platform_handle.h"
|
||||
#include "ppapi/buildflags/buildflags.h"
|
||||
#include "shell/browser/api/electron_api_browser_window.h"
|
||||
@@ -409,7 +411,7 @@ WebContents::WebContents(v8::Isolate* isolate,
|
||||
#endif
|
||||
registry_.AddInterface(base::BindRepeating(&WebContents::BindElectronBrowser,
|
||||
base::Unretained(this)));
|
||||
bindings_.set_connection_error_handler(base::BindRepeating(
|
||||
receivers_.set_disconnect_handler(base::BindRepeating(
|
||||
&WebContents::OnElectronBrowserConnectionError, base::Unretained(this)));
|
||||
}
|
||||
|
||||
@@ -586,7 +588,7 @@ void WebContents::InitWithSessionAndOptions(
|
||||
|
||||
registry_.AddInterface(base::BindRepeating(&WebContents::BindElectronBrowser,
|
||||
base::Unretained(this)));
|
||||
bindings_.set_connection_error_handler(base::BindRepeating(
|
||||
receivers_.set_disconnect_handler(base::BindRepeating(
|
||||
&WebContents::OnElectronBrowserConnectionError, base::Unretained(this)));
|
||||
AutofillDriverFactory::CreateForWebContents(web_contents());
|
||||
|
||||
@@ -1117,16 +1119,16 @@ bool WebContents::EmitNavigationEvent(
|
||||
}
|
||||
|
||||
void WebContents::BindElectronBrowser(
|
||||
mojom::ElectronBrowserRequest request,
|
||||
mojo::PendingReceiver<mojom::ElectronBrowser> receiver,
|
||||
content::RenderFrameHost* render_frame_host) {
|
||||
auto id = bindings_.AddBinding(this, std::move(request), render_frame_host);
|
||||
frame_to_bindings_map_[render_frame_host].push_back(id);
|
||||
auto id = receivers_.Add(this, std::move(receiver), render_frame_host);
|
||||
frame_to_receivers_map_[render_frame_host].push_back(id);
|
||||
}
|
||||
|
||||
void WebContents::OnElectronBrowserConnectionError() {
|
||||
auto binding_id = bindings_.dispatch_binding();
|
||||
auto* frame_host = bindings_.dispatch_context();
|
||||
base::Erase(frame_to_bindings_map_[frame_host], binding_id);
|
||||
auto receiver_id = receivers_.current_receiver();
|
||||
auto* frame_host = receivers_.current_context();
|
||||
base::Erase(frame_to_receivers_map_[frame_host], receiver_id);
|
||||
}
|
||||
|
||||
void WebContents::Message(bool internal,
|
||||
@@ -1135,7 +1137,7 @@ void WebContents::Message(bool internal,
|
||||
TRACE_EVENT1("electron", "WebContents::Message", "channel", channel);
|
||||
// webContents.emit('-ipc-message', new Event(), internal, channel,
|
||||
// arguments);
|
||||
EmitWithSender("-ipc-message", bindings_.dispatch_context(), InvokeCallback(),
|
||||
EmitWithSender("-ipc-message", receivers_.current_context(), InvokeCallback(),
|
||||
internal, channel, std::move(arguments));
|
||||
}
|
||||
|
||||
@@ -1145,7 +1147,7 @@ void WebContents::Invoke(bool internal,
|
||||
InvokeCallback callback) {
|
||||
TRACE_EVENT1("electron", "WebContents::Invoke", "channel", channel);
|
||||
// webContents.emit('-ipc-invoke', new Event(), internal, channel, arguments);
|
||||
EmitWithSender("-ipc-invoke", bindings_.dispatch_context(),
|
||||
EmitWithSender("-ipc-invoke", receivers_.current_context(),
|
||||
std::move(callback), internal, channel, std::move(arguments));
|
||||
}
|
||||
|
||||
@@ -1156,7 +1158,7 @@ void WebContents::ReceivePostMessage(const std::string& channel,
|
||||
MessagePort::EntanglePorts(isolate(), std::move(message.ports));
|
||||
v8::Local<v8::Value> message_value =
|
||||
electron::DeserializeV8Value(isolate(), message);
|
||||
EmitWithSender("-ipc-ports", bindings_.dispatch_context(), InvokeCallback(),
|
||||
EmitWithSender("-ipc-ports", receivers_.current_context(), InvokeCallback(),
|
||||
false, channel, message_value, std::move(wrapped_ports));
|
||||
}
|
||||
|
||||
@@ -1199,7 +1201,7 @@ void WebContents::MessageSync(bool internal,
|
||||
TRACE_EVENT1("electron", "WebContents::MessageSync", "channel", channel);
|
||||
// webContents.emit('-ipc-message-sync', new Event(sender, message), internal,
|
||||
// channel, arguments);
|
||||
EmitWithSender("-ipc-message-sync", bindings_.dispatch_context(),
|
||||
EmitWithSender("-ipc-message-sync", receivers_.current_context(),
|
||||
std::move(callback), internal, channel, std::move(arguments));
|
||||
}
|
||||
|
||||
@@ -1222,7 +1224,7 @@ void WebContents::MessageHost(const std::string& channel,
|
||||
blink::CloneableMessage arguments) {
|
||||
TRACE_EVENT1("electron", "WebContents::MessageHost", "channel", channel);
|
||||
// webContents.emit('ipc-message-host', new Event(), channel, args);
|
||||
EmitWithSender("ipc-message-host", bindings_.dispatch_context(),
|
||||
EmitWithSender("ipc-message-host", receivers_.current_context(),
|
||||
InvokeCallback(), channel, std::move(arguments));
|
||||
}
|
||||
|
||||
@@ -1234,7 +1236,7 @@ void WebContents::DereferenceRemoteJSObject(const std::string& context_id,
|
||||
args.Append(context_id);
|
||||
args.Append(object_id);
|
||||
args.Append(ref_count);
|
||||
EmitWithSender("-ipc-message", bindings_.dispatch_context(), InvokeCallback(),
|
||||
EmitWithSender("-ipc-message", receivers_.current_context(), InvokeCallback(),
|
||||
/* internal */ true, "ELECTRON_BROWSER_DEREFERENCE",
|
||||
std::move(args));
|
||||
}
|
||||
@@ -1253,12 +1255,12 @@ void WebContents::RenderFrameDeleted(
|
||||
// that no longer exist. To prevent this from happening, when a
|
||||
// RenderFrameHost goes away, we close all the bindings related to that
|
||||
// frame.
|
||||
auto it = frame_to_bindings_map_.find(render_frame_host);
|
||||
if (it == frame_to_bindings_map_.end())
|
||||
auto it = frame_to_receivers_map_.find(render_frame_host);
|
||||
if (it == frame_to_receivers_map_.end())
|
||||
return;
|
||||
for (auto id : it->second)
|
||||
bindings_.RemoveBinding(id);
|
||||
frame_to_bindings_map_.erase(it);
|
||||
receivers_.Remove(id);
|
||||
frame_to_receivers_map_.erase(it);
|
||||
}
|
||||
|
||||
void WebContents::DidStartNavigation(
|
||||
@@ -1342,6 +1344,7 @@ void WebContents::TitleWasSet(content::NavigationEntry* entry) {
|
||||
}
|
||||
|
||||
void WebContents::DidUpdateFaviconURL(
|
||||
content::RenderFrameHost* render_frame_host,
|
||||
const std::vector<blink::mojom::FaviconURLPtr>& urls) {
|
||||
std::set<GURL> unique_urls;
|
||||
for (const auto& iter : urls) {
|
||||
@@ -2167,7 +2170,7 @@ uint32_t WebContents::FindInPage(gin_helper::Arguments* args) {
|
||||
if (args->GetNext(&dict)) {
|
||||
dict.Get("forward", &options->forward);
|
||||
dict.Get("matchCase", &options->match_case);
|
||||
dict.Get("findNext", &options->find_next);
|
||||
dict.Get("findNext", &options->new_session);
|
||||
}
|
||||
|
||||
web_contents()->Find(request_id, search_text, std::move(options));
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include "electron/buildflags/buildflags.h"
|
||||
#include "electron/shell/common/api/api.mojom.h"
|
||||
#include "gin/handle.h"
|
||||
#include "mojo/public/cpp/bindings/binding_set.h"
|
||||
#include "mojo/public/cpp/bindings/receiver_set.h"
|
||||
#include "printing/buildflags/buildflags.h"
|
||||
#include "services/service_manager/public/cpp/binder_registry.h"
|
||||
#include "shell/browser/api/frame_subscriber.h"
|
||||
@@ -535,6 +535,7 @@ class WebContents : public gin_helper::TrackableObject<WebContents>,
|
||||
const content::LoadCommittedDetails& load_details) override;
|
||||
void TitleWasSet(content::NavigationEntry* entry) override;
|
||||
void DidUpdateFaviconURL(
|
||||
content::RenderFrameHost* render_frame_host,
|
||||
const std::vector<blink::mojom::FaviconURLPtr>& urls) override;
|
||||
void PluginCrashed(const base::FilePath& plugin_path,
|
||||
base::ProcessId plugin_pid) override;
|
||||
@@ -565,8 +566,9 @@ class WebContents : public gin_helper::TrackableObject<WebContents>,
|
||||
|
||||
// Binds the given request for the ElectronBrowser API. When the
|
||||
// RenderFrameHost is destroyed, all related bindings will be removed.
|
||||
void BindElectronBrowser(mojom::ElectronBrowserRequest request,
|
||||
content::RenderFrameHost* render_frame_host);
|
||||
void BindElectronBrowser(
|
||||
mojo::PendingReceiver<mojom::ElectronBrowser> receiver,
|
||||
content::RenderFrameHost* render_frame_host);
|
||||
void OnElectronBrowserConnectionError();
|
||||
|
||||
uint32_t GetNextRequestId() { return ++request_id_; }
|
||||
@@ -653,9 +655,10 @@ class WebContents : public gin_helper::TrackableObject<WebContents>,
|
||||
int currently_committed_process_id_ = -1;
|
||||
|
||||
service_manager::BinderRegistryWithArgs<content::RenderFrameHost*> registry_;
|
||||
mojo::BindingSet<mojom::ElectronBrowser, content::RenderFrameHost*> bindings_;
|
||||
std::map<content::RenderFrameHost*, std::vector<mojo::BindingId>>
|
||||
frame_to_bindings_map_;
|
||||
mojo::ReceiverSet<mojom::ElectronBrowser, content::RenderFrameHost*>
|
||||
receivers_;
|
||||
std::map<content::RenderFrameHost*, std::vector<mojo::ReceiverId>>
|
||||
frame_to_receivers_map_;
|
||||
|
||||
base::WeakPtrFactory<WebContents> weak_factory_;
|
||||
|
||||
|
||||
12
shell/browser/api/gpu_info_enumerator.cc
Normal file → Executable file
12
shell/browser/api/gpu_info_enumerator.cc
Normal file → Executable file
@@ -113,18 +113,6 @@ void GPUInfoEnumerator::EndAuxAttributes() {
|
||||
value_stack.pop();
|
||||
}
|
||||
|
||||
void GPUInfoEnumerator::BeginDx12VulkanVersionInfo() {
|
||||
value_stack.push(std::move(current));
|
||||
current = std::make_unique<base::DictionaryValue>();
|
||||
}
|
||||
|
||||
void GPUInfoEnumerator::EndDx12VulkanVersionInfo() {
|
||||
auto& top_value = value_stack.top();
|
||||
top_value->SetDictionary(kDx12VulkanVersionInfoKey, std::move(current));
|
||||
current = std::move(top_value);
|
||||
value_stack.pop();
|
||||
}
|
||||
|
||||
void GPUInfoEnumerator::BeginOverlayInfo() {
|
||||
value_stack.push(std::move(current));
|
||||
current = std::make_unique<base::DictionaryValue>();
|
||||
|
||||
3
shell/browser/api/gpu_info_enumerator.h
Normal file → Executable file
3
shell/browser/api/gpu_info_enumerator.h
Normal file → Executable file
@@ -25,7 +25,6 @@ class GPUInfoEnumerator final : public gpu::GPUInfo::Enumerator {
|
||||
const char* kImageDecodeAcceleratorSupportedProfileKey =
|
||||
"imageDecodeAcceleratorSupportedProfile";
|
||||
const char* kAuxAttributesKey = "auxAttributes";
|
||||
const char* kDx12VulkanVersionInfoKey = "dx12VulkanVersionInfo";
|
||||
const char* kOverlayInfo = "overlayInfo";
|
||||
|
||||
public:
|
||||
@@ -49,8 +48,6 @@ class GPUInfoEnumerator final : public gpu::GPUInfo::Enumerator {
|
||||
void EndImageDecodeAcceleratorSupportedProfile() override;
|
||||
void BeginAuxAttributes() override;
|
||||
void EndAuxAttributes() override;
|
||||
void BeginDx12VulkanVersionInfo() override;
|
||||
void EndDx12VulkanVersionInfo() override;
|
||||
void BeginOverlayInfo() override;
|
||||
void EndOverlayInfo() override;
|
||||
std::unique_ptr<base::DictionaryValue> GetDictionary();
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include <utility>
|
||||
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/no_destructor.h"
|
||||
#include "base/path_service.h"
|
||||
#include "base/run_loop.h"
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
#include "base/base_switches.h"
|
||||
#include "base/command_line.h"
|
||||
#include "base/feature_list.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/path_service.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "chrome/browser/icon_manager.h"
|
||||
|
||||
@@ -129,7 +129,7 @@ void ElectronDownloadManagerDelegate::OnDownloadPathGenerated(
|
||||
std::move(callback).Run(path,
|
||||
download::DownloadItem::TARGET_DISPOSITION_PROMPT,
|
||||
download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
|
||||
item->GetMixedContentStatus(), path,
|
||||
item->GetMixedContentStatus(), path, base::nullopt,
|
||||
download::DOWNLOAD_INTERRUPT_REASON_NONE);
|
||||
}
|
||||
}
|
||||
@@ -173,7 +173,8 @@ void ElectronDownloadManagerDelegate::OnDownloadSaveDialogDone(
|
||||
std::move(download_callback)
|
||||
.Run(path, download::DownloadItem::TARGET_DISPOSITION_PROMPT,
|
||||
download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
|
||||
item->GetMixedContentStatus(), path, interrupt_reason);
|
||||
item->GetMixedContentStatus(), path, base::nullopt,
|
||||
interrupt_reason);
|
||||
}
|
||||
|
||||
void ElectronDownloadManagerDelegate::Shutdown() {
|
||||
@@ -192,7 +193,7 @@ bool ElectronDownloadManagerDelegate::DetermineDownloadTarget(
|
||||
download::DownloadItem::TARGET_DISPOSITION_OVERWRITE,
|
||||
download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
|
||||
download::DownloadItem::MixedContentStatus::UNKNOWN,
|
||||
download->GetForcedFilePath(),
|
||||
download->GetForcedFilePath(), base::nullopt,
|
||||
download::DOWNLOAD_INTERRUPT_REASON_NONE);
|
||||
return true;
|
||||
}
|
||||
@@ -205,7 +206,7 @@ bool ElectronDownloadManagerDelegate::DetermineDownloadTarget(
|
||||
save_path, download::DownloadItem::TARGET_DISPOSITION_OVERWRITE,
|
||||
download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
|
||||
download::DownloadItem::MixedContentStatus::UNKNOWN, save_path,
|
||||
download::DOWNLOAD_INTERRUPT_REASON_NONE);
|
||||
base::nullopt, download::DOWNLOAD_INTERRUPT_REASON_NONE);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -68,9 +68,7 @@ void AddAdditionalDataForPdf(base::DictionaryValue* dict) {
|
||||
dict->SetKey("pdfFormSaveEnabled",
|
||||
base::Value(base::FeatureList::IsEnabled(
|
||||
chrome_pdf::features::kSaveEditedPDFForm)));
|
||||
dict->SetKey("pdfAnnotationsEnabled",
|
||||
base::Value(base::FeatureList::IsEnabled(
|
||||
chrome_pdf::features::kPDFAnnotations)));
|
||||
dict->SetKey("pdfAnnotationsEnabled", base::Value(false));
|
||||
dict->SetKey("pdfTwoUpViewEnabled",
|
||||
base::Value(base::FeatureList::IsEnabled(
|
||||
chrome_pdf::features::kPDFTwoUpView)));
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "base/callback.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/ref_counted.h"
|
||||
#include "base/memory/weak_ptr.h"
|
||||
|
||||
14
shell/browser/extensions/electron_extension_system.cc
Normal file → Executable file
14
shell/browser/extensions/electron_extension_system.cc
Normal file → Executable file
@@ -30,7 +30,7 @@
|
||||
#include "extensions/browser/quota_service.h"
|
||||
#include "extensions/browser/runtime_data.h"
|
||||
#include "extensions/browser/service_worker_manager.h"
|
||||
#include "extensions/browser/shared_user_script_master.h"
|
||||
#include "extensions/browser/shared_user_script_manager.h"
|
||||
#include "extensions/browser/value_store/value_store_factory_impl.h"
|
||||
#include "extensions/common/constants.h"
|
||||
#include "extensions/common/file_util.h"
|
||||
@@ -83,8 +83,8 @@ void ElectronExtensionSystem::InitForRegularProfile(bool extensions_enabled) {
|
||||
runtime_data_ =
|
||||
std::make_unique<RuntimeData>(ExtensionRegistry::Get(browser_context_));
|
||||
quota_service_ = std::make_unique<QuotaService>();
|
||||
shared_user_script_master_ =
|
||||
std::make_unique<SharedUserScriptMaster>(browser_context_);
|
||||
shared_user_script_manager_ =
|
||||
std::make_unique<SharedUserScriptManager>(browser_context_);
|
||||
app_sorting_ = std::make_unique<NullAppSorting>();
|
||||
extension_loader_ =
|
||||
std::make_unique<ElectronExtensionLoader>(browser_context_);
|
||||
@@ -137,8 +137,8 @@ ServiceWorkerManager* ElectronExtensionSystem::service_worker_manager() {
|
||||
return service_worker_manager_.get();
|
||||
}
|
||||
|
||||
SharedUserScriptMaster* ElectronExtensionSystem::shared_user_script_master() {
|
||||
return new SharedUserScriptMaster(browser_context_);
|
||||
SharedUserScriptManager* ElectronExtensionSystem::shared_user_script_manager() {
|
||||
return new SharedUserScriptManager(browser_context_);
|
||||
}
|
||||
|
||||
StateStore* ElectronExtensionSystem::state_store() {
|
||||
@@ -185,6 +185,10 @@ const base::OneShotEvent& ElectronExtensionSystem::ready() const {
|
||||
return ready_;
|
||||
}
|
||||
|
||||
bool ElectronExtensionSystem::is_ready() const {
|
||||
return ready_.is_signaled();
|
||||
}
|
||||
|
||||
ContentVerifier* ElectronExtensionSystem::content_verifier() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
5
shell/browser/extensions/electron_extension_system.h
Normal file → Executable file
5
shell/browser/extensions/electron_extension_system.h
Normal file → Executable file
@@ -60,7 +60,7 @@ class ElectronExtensionSystem : public ExtensionSystem {
|
||||
RuntimeData* runtime_data() override;
|
||||
ManagementPolicy* management_policy() override;
|
||||
ServiceWorkerManager* service_worker_manager() override;
|
||||
SharedUserScriptMaster* shared_user_script_master() override;
|
||||
SharedUserScriptManager* shared_user_script_manager() override;
|
||||
StateStore* state_store() override;
|
||||
StateStore* rules_store() override;
|
||||
scoped_refptr<ValueStoreFactory> store_factory() override;
|
||||
@@ -74,6 +74,7 @@ class ElectronExtensionSystem : public ExtensionSystem {
|
||||
const std::string& extension_id,
|
||||
const UnloadedExtensionReason reason) override;
|
||||
const base::OneShotEvent& ready() const override;
|
||||
bool is_ready() const override;
|
||||
ContentVerifier* content_verifier() override;
|
||||
std::unique_ptr<ExtensionSet> GetDependentExtensions(
|
||||
const Extension* extension) override;
|
||||
@@ -101,7 +102,7 @@ class ElectronExtensionSystem : public ExtensionSystem {
|
||||
std::unique_ptr<ServiceWorkerManager> service_worker_manager_;
|
||||
std::unique_ptr<RuntimeData> runtime_data_;
|
||||
std::unique_ptr<QuotaService> quota_service_;
|
||||
std::unique_ptr<SharedUserScriptMaster> shared_user_script_master_;
|
||||
std::unique_ptr<SharedUserScriptManager> shared_user_script_manager_;
|
||||
std::unique_ptr<AppSorting> app_sorting_;
|
||||
|
||||
std::unique_ptr<ElectronExtensionLoader> extension_loader_;
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "content/public/common/content_features.h"
|
||||
#include "electron/buildflags/buildflags.h"
|
||||
#include "media/base/media_switches.h"
|
||||
#include "net/base/features.h"
|
||||
|
||||
namespace electron {
|
||||
|
||||
@@ -26,7 +27,14 @@ void InitializeFeatureList() {
|
||||
// Can be reenabled when our site instance policy is aligned with chromium
|
||||
// when node integration is enabled.
|
||||
disable_features +=
|
||||
std::string(",") + features::kSpareRendererForSitePerProcess.name;
|
||||
std::string(",") + features::kSpareRendererForSitePerProcess.name +
|
||||
// Disable SameSite-by-default, this will be a breaking change for many
|
||||
// apps which cannot land in master until 11-x-y is branched out. For more
|
||||
// info
|
||||
// https://groups.google.com/a/chromium.org/g/embedder-dev/c/4yJi4Twj2NM/m/9bhpWureCAAJ
|
||||
std::string(",") + net::features::kSameSiteByDefaultCookies.name +
|
||||
std::string(",") +
|
||||
net::features::kCookiesWithoutSameSiteMustBeSecure.name;
|
||||
|
||||
// https://www.polymer-project.org/blog/2018-10-02-webcomponents-v0-deprecations
|
||||
// https://chromium-review.googlesource.com/c/chromium/src/+/1869562
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "base/bind.h"
|
||||
#include "base/command_line.h"
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/logging.h"
|
||||
#include "device/bluetooth/dbus/bluez_dbus_thread_manager.h"
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -659,10 +659,11 @@ bool NativeWindowViews::MoveAbove(const std::string& sourceId) {
|
||||
0, 0, 0,
|
||||
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
|
||||
#elif defined(USE_X11)
|
||||
if (!IsWindowValid(id.id))
|
||||
if (!IsWindowValid(static_cast<x11::Window>(id.id)))
|
||||
return false;
|
||||
|
||||
electron::MoveWindowAbove(GetAcceleratedWidget(), id.id);
|
||||
electron::MoveWindowAbove(GetAcceleratedWidget(),
|
||||
static_cast<x11::Window>(id.id));
|
||||
#endif
|
||||
|
||||
return true;
|
||||
@@ -956,12 +957,14 @@ void NativeWindowViews::SetIgnoreMouseEvents(bool ignore, bool forward) {
|
||||
#elif defined(USE_X11)
|
||||
if (ignore) {
|
||||
XRectangle r = {0, 0, 1, 1};
|
||||
XShapeCombineRectangles(gfx::GetXDisplay(), GetAcceleratedWidget(),
|
||||
XShapeCombineRectangles(gfx::GetXDisplay(),
|
||||
static_cast<uint32_t>(GetAcceleratedWidget()),
|
||||
ShapeInput, 0, 0, &r, 1, ShapeSet,
|
||||
static_cast<int>(x11::ClipOrdering::YXBanded));
|
||||
} else {
|
||||
XShapeCombineMask(gfx::GetXDisplay(), GetAcceleratedWidget(), ShapeInput, 0,
|
||||
0, x11::None, ShapeSet);
|
||||
XShapeCombineMask(gfx::GetXDisplay(),
|
||||
static_cast<uint32_t>(GetAcceleratedWidget()), ShapeInput,
|
||||
0, 0, x11::None, ShapeSet);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -1070,8 +1073,9 @@ void NativeWindowViews::SetParentWindow(NativeWindow* parent) {
|
||||
#if defined(USE_X11)
|
||||
XDisplay* xdisplay = gfx::GetXDisplay();
|
||||
XSetTransientForHint(
|
||||
xdisplay, GetAcceleratedWidget(),
|
||||
parent ? parent->GetAcceleratedWidget() : DefaultRootWindow(xdisplay));
|
||||
xdisplay, static_cast<uint32_t>(GetAcceleratedWidget()),
|
||||
static_cast<uint32_t>(parent ? parent->GetAcceleratedWidget()
|
||||
: ui::GetX11RootWindow()));
|
||||
#elif defined(OS_WIN)
|
||||
// To set parentship between windows into Windows is better to play with the
|
||||
// owner instead of the parent, as Windows natively seems to do if a parent
|
||||
@@ -1164,7 +1168,7 @@ content::DesktopMediaID NativeWindowViews::GetDesktopMediaID() const {
|
||||
window_handle =
|
||||
reinterpret_cast<content::DesktopMediaID::Id>(accelerated_widget);
|
||||
#elif defined(USE_X11)
|
||||
window_handle = accelerated_widget;
|
||||
window_handle = static_cast<uint32_t>(accelerated_widget);
|
||||
#endif
|
||||
aura::WindowTreeHost* const host =
|
||||
aura::WindowTreeHost::GetForAcceleratedWidget(accelerated_widget);
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "base/mac/scoped_nsobject.h"
|
||||
#include "shell/browser/notifications/notification.h"
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "base/environment.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/hash/md5.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/threading/thread_restrictions.h"
|
||||
#include "base/time/time.h"
|
||||
|
||||
@@ -437,7 +437,7 @@ content::CursorManager* OffScreenRenderWidgetHostView::GetCursorManager() {
|
||||
void OffScreenRenderWidgetHostView::SetIsLoading(bool loading) {}
|
||||
|
||||
void OffScreenRenderWidgetHostView::TextInputStateChanged(
|
||||
const content::TextInputState& params) {}
|
||||
const ui::mojom::TextInputState& params) {}
|
||||
|
||||
void OffScreenRenderWidgetHostView::ImeCancelComposition() {}
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ class OffScreenRenderWidgetHostView : public content::RenderWidgetHostViewBase,
|
||||
void InitAsFullscreen(content::RenderWidgetHostView*) override;
|
||||
void UpdateCursor(const content::WebCursor&) override;
|
||||
void SetIsLoading(bool is_loading) override;
|
||||
void TextInputStateChanged(const content::TextInputState& params) override;
|
||||
void TextInputStateChanged(const ui::mojom::TextInputState& params) override;
|
||||
void ImeCancelComposition(void) override;
|
||||
void RenderProcessGone() override;
|
||||
void Destroy(void) override;
|
||||
|
||||
@@ -112,16 +112,12 @@ void OffScreenVideoConsumer::OnFrameCaptured(
|
||||
new FramePinner{std::move(mapping), callbacks_remote.Unbind()});
|
||||
bitmap.setImmutable();
|
||||
|
||||
media::VideoFrameMetadata metadata;
|
||||
metadata.MergeInternalValuesFrom(info->metadata);
|
||||
gfx::Rect damage_rect;
|
||||
|
||||
auto UPDATE_RECT = media::VideoFrameMetadata::CAPTURE_UPDATE_RECT;
|
||||
if (!metadata.GetRect(UPDATE_RECT, &damage_rect) || damage_rect.IsEmpty()) {
|
||||
damage_rect = content_rect;
|
||||
base::Optional<gfx::Rect> update_rect = info->metadata.capture_update_rect;
|
||||
if (!update_rect.has_value() || update_rect->IsEmpty()) {
|
||||
update_rect = content_rect;
|
||||
}
|
||||
|
||||
callback_.Run(damage_rect, bitmap);
|
||||
callback_.Run(*update_rect, bitmap);
|
||||
}
|
||||
|
||||
void OffScreenVideoConsumer::OnStopped() {}
|
||||
|
||||
@@ -138,12 +138,6 @@ void PrintPreviewMessageHandler::PrintPreviewCancelled(int32_t document_cookie,
|
||||
RejectPromise(request_id);
|
||||
}
|
||||
|
||||
void PrintPreviewMessageHandler::CheckForCancel(
|
||||
int32_t request_id,
|
||||
CheckForCancelCallback callback) {
|
||||
std::move(callback).Run(false);
|
||||
}
|
||||
|
||||
void PrintPreviewMessageHandler::PrintToPDF(
|
||||
base::DictionaryValue options,
|
||||
gin_helper::Promise<v8::Local<v8::Value>> promise) {
|
||||
|
||||
@@ -56,8 +56,6 @@ class PrintPreviewMessageHandler
|
||||
const PrintHostMsg_PreviewIds& ids,
|
||||
printing::mojom::PrintCompositor::Status status,
|
||||
base::ReadOnlySharedMemoryRegion region);
|
||||
void CheckForCancel(int32_t request_id,
|
||||
CheckForCancelCallback callback) override;
|
||||
|
||||
// printing::mojo::PrintPreviewUI:
|
||||
void SetOptionsFromDocument(
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "base/process/launch.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "base/win/scoped_handle.h"
|
||||
|
||||
1
shell/browser/session_preferences.cc
Normal file → Executable file
1
shell/browser/session_preferences.cc
Normal file → Executable file
@@ -4,6 +4,7 @@
|
||||
|
||||
#include "shell/browser/session_preferences.h"
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
|
||||
namespace electron {
|
||||
|
||||
1
shell/browser/ui/accelerator_util.cc
Normal file → Executable file
1
shell/browser/ui/accelerator_util.cc
Normal file → Executable file
@@ -9,6 +9,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "base/stl_util.h"
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "base/strings/string_split.h"
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#include "shell/browser/ui/inspectable_web_contents_view.h"
|
||||
|
||||
#include "base/mac/scoped_nsobject.h"
|
||||
#include "base/macros.h"
|
||||
|
||||
@class ElectronInspectableWebContentsView;
|
||||
|
||||
|
||||
@@ -172,24 +172,24 @@ std::string GetMenuModelStatus(ElectronMenuModel* model) {
|
||||
|
||||
GlobalMenuBarX11::GlobalMenuBarX11(NativeWindowViews* window)
|
||||
: window_(window),
|
||||
xid_(window_->GetNativeWindow()->GetHost()->GetAcceleratedWidget()) {
|
||||
xwindow_(window_->GetNativeWindow()->GetHost()->GetAcceleratedWidget()) {
|
||||
EnsureMethodsLoaded();
|
||||
if (server_new)
|
||||
InitServer(xid_);
|
||||
InitServer(xwindow_);
|
||||
|
||||
GlobalMenuBarRegistrarX11::GetInstance()->OnWindowMapped(xid_);
|
||||
GlobalMenuBarRegistrarX11::GetInstance()->OnWindowMapped(xwindow_);
|
||||
}
|
||||
|
||||
GlobalMenuBarX11::~GlobalMenuBarX11() {
|
||||
if (IsServerStarted())
|
||||
g_object_unref(server_);
|
||||
|
||||
GlobalMenuBarRegistrarX11::GetInstance()->OnWindowUnmapped(xid_);
|
||||
GlobalMenuBarRegistrarX11::GetInstance()->OnWindowUnmapped(xwindow_);
|
||||
}
|
||||
|
||||
// static
|
||||
std::string GlobalMenuBarX11::GetPathForWindow(gfx::AcceleratedWidget xid) {
|
||||
return base::StringPrintf("/com/canonical/menu/%lX", xid);
|
||||
std::string GlobalMenuBarX11::GetPathForWindow(x11::Window window) {
|
||||
return base::StringPrintf("/com/canonical/menu/%X", window);
|
||||
}
|
||||
|
||||
void GlobalMenuBarX11::SetMenu(ElectronMenuModel* menu_model) {
|
||||
@@ -211,17 +211,17 @@ bool GlobalMenuBarX11::IsServerStarted() const {
|
||||
return server_;
|
||||
}
|
||||
|
||||
void GlobalMenuBarX11::InitServer(gfx::AcceleratedWidget xid) {
|
||||
std::string path = GetPathForWindow(xid);
|
||||
void GlobalMenuBarX11::InitServer(x11::Window window) {
|
||||
std::string path = GetPathForWindow(window);
|
||||
server_ = server_new(path.c_str());
|
||||
}
|
||||
|
||||
void GlobalMenuBarX11::OnWindowMapped() {
|
||||
GlobalMenuBarRegistrarX11::GetInstance()->OnWindowMapped(xid_);
|
||||
GlobalMenuBarRegistrarX11::GetInstance()->OnWindowMapped(xwindow_);
|
||||
}
|
||||
|
||||
void GlobalMenuBarX11::OnWindowUnmapped() {
|
||||
GlobalMenuBarRegistrarX11::GetInstance()->OnWindowUnmapped(xid_);
|
||||
GlobalMenuBarRegistrarX11::GetInstance()->OnWindowUnmapped(xwindow_);
|
||||
}
|
||||
|
||||
void GlobalMenuBarX11::BuildMenuFromModel(ElectronMenuModel* model,
|
||||
|
||||
@@ -40,8 +40,8 @@ class GlobalMenuBarX11 {
|
||||
explicit GlobalMenuBarX11(NativeWindowViews* window);
|
||||
virtual ~GlobalMenuBarX11();
|
||||
|
||||
// Creates the object path for DbusmenuServer which is attached to |xid|.
|
||||
static std::string GetPathForWindow(gfx::AcceleratedWidget xid);
|
||||
// Creates the object path for DbusmenuServer which is attached to |window|.
|
||||
static std::string GetPathForWindow(x11::Window window);
|
||||
|
||||
void SetMenu(ElectronMenuModel* menu_model);
|
||||
bool IsServerStarted() const;
|
||||
@@ -52,7 +52,7 @@ class GlobalMenuBarX11 {
|
||||
|
||||
private:
|
||||
// Creates a DbusmenuServer.
|
||||
void InitServer(gfx::AcceleratedWidget xid);
|
||||
void InitServer(x11::Window window);
|
||||
|
||||
// Create a menu from menu model.
|
||||
void BuildMenuFromModel(ElectronMenuModel* model, DbusmenuMenuitem* parent);
|
||||
@@ -69,7 +69,7 @@ class GlobalMenuBarX11 {
|
||||
CHROMEG_CALLBACK_0(GlobalMenuBarX11, void, OnSubMenuShow, DbusmenuMenuitem*);
|
||||
|
||||
NativeWindowViews* window_;
|
||||
gfx::AcceleratedWidget xid_;
|
||||
x11::Window xwindow_;
|
||||
|
||||
DbusmenuServer* server_ = nullptr;
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <propkey.h> // for PKEY_* constants
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "base/win/scoped_co_mem.h"
|
||||
#include "base/win/scoped_propvariant.h"
|
||||
#include "base/win/win_util.h"
|
||||
|
||||
1
shell/browser/ui/win/notify_icon.cc
Normal file → Executable file
1
shell/browser/ui/win/notify_icon.cc
Normal file → Executable file
@@ -7,6 +7,7 @@
|
||||
#include <objbase.h>
|
||||
#include <utility>
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/win/windows_version.h"
|
||||
|
||||
1
shell/browser/ui/win/notify_icon_host.cc
Normal file → Executable file
1
shell/browser/ui/win/notify_icon_host.cc
Normal file → Executable file
@@ -8,6 +8,7 @@
|
||||
#include <winuser.h>
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/stl_util.h"
|
||||
#include "base/win/win_util.h"
|
||||
#include "base/win/wrapped_window_proc.h"
|
||||
|
||||
@@ -18,15 +18,15 @@ WindowStateWatcher::~WindowStateWatcher() {
|
||||
ui::X11EventSource::GetInstance()->RemoveXEventObserver(this);
|
||||
}
|
||||
|
||||
void WindowStateWatcher::WillProcessXEvent(XEvent* xev) {
|
||||
if (IsWindowStateEvent(xev)) {
|
||||
void WindowStateWatcher::WillProcessXEvent(x11::Event* x11_event) {
|
||||
if (IsWindowStateEvent(x11_event)) {
|
||||
was_minimized_ = window_->IsMinimized();
|
||||
was_maximized_ = window_->IsMaximized();
|
||||
}
|
||||
}
|
||||
|
||||
void WindowStateWatcher::DidProcessXEvent(XEvent* xev) {
|
||||
if (IsWindowStateEvent(xev)) {
|
||||
void WindowStateWatcher::DidProcessXEvent(x11::Event* x11_event) {
|
||||
if (IsWindowStateEvent(x11_event)) {
|
||||
bool is_minimized = window_->IsMinimized();
|
||||
bool is_maximized = window_->IsMaximized();
|
||||
bool is_fullscreen = window_->IsFullscreen();
|
||||
@@ -54,9 +54,11 @@ void WindowStateWatcher::DidProcessXEvent(XEvent* xev) {
|
||||
}
|
||||
}
|
||||
|
||||
bool WindowStateWatcher::IsWindowStateEvent(XEvent* xev) const {
|
||||
bool WindowStateWatcher::IsWindowStateEvent(x11::Event* x11_event) const {
|
||||
XEvent* xev = &x11_event->xlib_event();
|
||||
return (static_cast<x11::Atom>(xev->xproperty.atom) == window_state_atom_ &&
|
||||
xev->type == PropertyNotify && xev->xproperty.window == widget_);
|
||||
xev->type == PropertyNotify &&
|
||||
xev->xproperty.window == static_cast<uint32_t>(widget_));
|
||||
}
|
||||
|
||||
} // namespace electron
|
||||
|
||||
@@ -19,11 +19,11 @@ class WindowStateWatcher : public ui::XEventObserver {
|
||||
|
||||
protected:
|
||||
// ui::XEventObserver:
|
||||
void WillProcessXEvent(XEvent* xev) override;
|
||||
void DidProcessXEvent(XEvent* xev) override;
|
||||
void WillProcessXEvent(x11::Event* x11_event) override;
|
||||
void DidProcessXEvent(x11::Event* x11_event) override;
|
||||
|
||||
private:
|
||||
bool IsWindowStateEvent(XEvent* xev) const;
|
||||
bool IsWindowStateEvent(x11::Event* x11_event) const;
|
||||
|
||||
NativeWindowViews* window_;
|
||||
gfx::AcceleratedWidget widget_;
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
|
||||
namespace electron {
|
||||
|
||||
void SetWMSpecState(::Window xwindow, bool enabled, x11::Atom state) {
|
||||
void SetWMSpecState(x11::Window window, bool enabled, x11::Atom state) {
|
||||
XEvent xclient;
|
||||
memset(&xclient, 0, sizeof(xclient));
|
||||
xclient.type = ClientMessage;
|
||||
xclient.xclient.window = xwindow;
|
||||
xclient.xclient.window = static_cast<uint32_t>(window);
|
||||
xclient.xclient.message_type =
|
||||
static_cast<uint32_t>(gfx::GetAtom("_NET_WM_STATE"));
|
||||
xclient.xclient.format = 32;
|
||||
@@ -37,10 +37,10 @@ void SetWMSpecState(::Window xwindow, bool enabled, x11::Atom state) {
|
||||
SubstructureRedirectMask | SubstructureNotifyMask, &xclient);
|
||||
}
|
||||
|
||||
void SetWindowType(::Window xwindow, const std::string& type) {
|
||||
void SetWindowType(x11::Window window, const std::string& type) {
|
||||
std::string type_prefix = "_NET_WM_WINDOW_TYPE_";
|
||||
x11::Atom window_type = gfx::GetAtom(type_prefix + base::ToUpperASCII(type));
|
||||
ui::SetProperty(xwindow, gfx::GetAtom("_NET_WM_WINDOW_TYPE"), x11::Atom::ATOM,
|
||||
ui::SetProperty(window, gfx::GetAtom("_NET_WM_WINDOW_TYPE"), x11::Atom::ATOM,
|
||||
window_type);
|
||||
}
|
||||
|
||||
@@ -82,23 +82,23 @@ bool ShouldUseGlobalMenuBar() {
|
||||
return false;
|
||||
}
|
||||
|
||||
void MoveWindowToForeground(::Window xwindow) {
|
||||
MoveWindowAbove(xwindow, 0);
|
||||
void MoveWindowToForeground(x11::Window window) {
|
||||
MoveWindowAbove(window, static_cast<x11::Window>(0));
|
||||
}
|
||||
|
||||
void MoveWindowAbove(::Window xwindow, ::Window other_xwindow) {
|
||||
void MoveWindowAbove(x11::Window window, x11::Window other_window) {
|
||||
XDisplay* xdisplay = gfx::GetXDisplay();
|
||||
XEvent xclient;
|
||||
memset(&xclient, 0, sizeof(xclient));
|
||||
|
||||
xclient.type = ClientMessage;
|
||||
xclient.xclient.display = xdisplay;
|
||||
xclient.xclient.window = xwindow;
|
||||
xclient.xclient.window = static_cast<uint32_t>(window);
|
||||
xclient.xclient.message_type =
|
||||
static_cast<uint32_t>(gfx::GetAtom("_NET_RESTACK_WINDOW"));
|
||||
xclient.xclient.format = 32;
|
||||
xclient.xclient.data.l[0] = 2;
|
||||
xclient.xclient.data.l[1] = other_xwindow;
|
||||
xclient.xclient.data.l[1] = static_cast<uint32_t>(other_window);
|
||||
xclient.xclient.data.l[2] = static_cast<uint32_t>(x11::StackMode::Above);
|
||||
xclient.xclient.data.l[3] = 0;
|
||||
xclient.xclient.data.l[4] = 0;
|
||||
@@ -108,9 +108,10 @@ void MoveWindowAbove(::Window xwindow, ::Window other_xwindow) {
|
||||
XFlush(xdisplay);
|
||||
}
|
||||
|
||||
bool IsWindowValid(::Window xwindow) {
|
||||
bool IsWindowValid(x11::Window window) {
|
||||
XWindowAttributes attrs;
|
||||
return XGetWindowAttributes(gfx::GetXDisplay(), xwindow, &attrs);
|
||||
return XGetWindowAttributes(gfx::GetXDisplay(), static_cast<uint32_t>(window),
|
||||
&attrs);
|
||||
}
|
||||
|
||||
} // namespace electron
|
||||
|
||||
@@ -13,22 +13,22 @@ namespace electron {
|
||||
|
||||
// Sends a message to the x11 window manager, enabling or disabling the |state|
|
||||
// for _NET_WM_STATE.
|
||||
void SetWMSpecState(::Window xwindow, bool enabled, x11::Atom state);
|
||||
void SetWMSpecState(x11::Window window, bool enabled, x11::Atom state);
|
||||
|
||||
// Sets the _NET_WM_WINDOW_TYPE of window.
|
||||
void SetWindowType(::Window xwindow, const std::string& type);
|
||||
void SetWindowType(x11::Window window, const std::string& type);
|
||||
|
||||
// Returns true if the bus name "com.canonical.AppMenu.Registrar" is available.
|
||||
bool ShouldUseGlobalMenuBar();
|
||||
|
||||
// Bring the given window to the front regardless of focus.
|
||||
void MoveWindowToForeground(::Window xwindow);
|
||||
void MoveWindowToForeground(x11::Window window);
|
||||
|
||||
// Move a given window above the other one.
|
||||
void MoveWindowAbove(::Window xwindow, ::Window other_xwindow);
|
||||
void MoveWindowAbove(x11::Window window, x11::Window other_window);
|
||||
|
||||
// Return true is the given window exists, false otherwise.
|
||||
bool IsWindowValid(::Window xwindow);
|
||||
bool IsWindowValid(x11::Window window);
|
||||
|
||||
} // namespace electron
|
||||
|
||||
|
||||
Reference in New Issue
Block a user