1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
--- electron/shell/browser/api/electron_api_web_contents.cc.orig 2023-01-24 08:00:52 UTC
+++ electron/shell/browser/api/electron_api_web_contents.cc
@@ -153,11 +153,11 @@
#include "ui/base/cocoa/defaults_utils.h"
#endif
-#if BUILDFLAG(IS_LINUX)
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
#include "ui/linux/linux_ui.h"
#endif
-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
#include "ui/gfx/font_render_params.h"
#endif
@@ -398,7 +398,7 @@ absl::optional<base::TimeDelta> GetCursorBlinkInterval
ui::TextInsertionCaretBlinkPeriodFromDefaults());
if (system_value)
return *system_value;
-#elif BUILDFLAG(IS_LINUX)
+#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
if (auto* linux_ui = ui::LinuxUi::instance())
return linux_ui->GetCursorBlinkInterval();
#elif BUILDFLAG(IS_WIN)
@@ -850,7 +850,7 @@ void WebContents::InitWithSessionAndOptions(
accept_languages.pop_back();
prefs->accept_languages = accept_languages;
-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN) || BUILDFLAG(IS_BSD)
// Update font settings.
static const gfx::FontRenderParams params(
gfx::GetFontRenderParams(gfx::FontRenderParamsQuery(), nullptr));
@@ -2355,7 +2355,7 @@ void WebContents::ForcefullyCrashRenderer() {
content::RenderProcessHost* rph = rwh->GetProcess();
if (rph) {
-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_BSD)
// A generic |CrashDumpHungChildProcess()| is not implemented for Linux.
// Instead we send an explicit IPC to crash on the renderer's IO thread.
rph->ForceCrash();
@@ -2998,7 +2998,7 @@ void WebContents::CopyImageAt(int x, int y) {
void WebContents::Focus() {
// Focusing on WebContents does not automatically focus the window on macOS
// and Linux, do it manually to match the behavior on Windows.
-#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
+#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
if (owner_window())
owner_window()->Focus(true);
#endif
@@ -3802,7 +3802,7 @@ ui::ImageModel WebContents::GetDevToolsWindowIcon() {
}
#endif
-#if BUILDFLAG(IS_LINUX)
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
void WebContents::GetDevToolsWindowWMClass(std::string* name,
std::string* class_name) {
*class_name = Browser::Get()->GetName();
|