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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
--- chrome/browser/ui/views/frame/picture_in_picture_browser_frame_view.cc.orig 2023-10-11 18:22:24 UTC
+++ chrome/browser/ui/views/frame/picture_in_picture_browser_frame_view.cc
@@ -53,7 +53,7 @@
#include "ui/aura/window.h"
#endif
-#if BUILDFLAG(IS_LINUX)
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
#include "chrome/browser/ui/views/frame/browser_frame_view_paint_utils_linux.h"
#include "chrome/browser/ui/views/frame/desktop_browser_frame_aura_linux.h"
#endif
@@ -80,7 +80,7 @@ constexpr int kBackToTabImageSize = 16;
// The height of the controls bar at the top of the window.
constexpr int kTopControlsHeight = 30;
-#if BUILDFLAG(IS_LINUX)
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
// Frame border when window shadow is not drawn.
constexpr int kFrameBorderThickness = 4;
#endif
@@ -175,7 +175,7 @@ class WindowEventObserver : public ui::EventObserver {
gfx::Rect input_bounds = pip_browser_frame_view_->GetLocalBounds();
-#if BUILDFLAG(IS_LINUX)
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
// Calculate input bounds for Linux. This is needed because the input bounds
// is not necessary the same as the local bounds on Linux.
if (pip_browser_frame_view_->ShouldDrawFrameShadow()) {
@@ -534,7 +534,7 @@ PictureInPictureBrowserFrameView::PictureInPictureBrow
}
#endif
-#if BUILDFLAG(IS_LINUX)
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
frame_background_ = std::make_unique<views::FrameBackground>();
#endif
@@ -709,7 +709,7 @@ void PictureInPictureBrowserFrameView::OnThemeChanged(
for (ContentSettingImageView* view : content_setting_views_)
view->SetIconColor(color_provider->GetColor(kColorPipWindowForeground));
-#if !BUILDFLAG(IS_LINUX)
+#if !BUILDFLAG(IS_LINUX) && !BUILDFLAG(IS_BSD)
// On Linux the top bar background will be drawn in OnPaint().
top_bar_container_view_->SetBackground(views::CreateSolidBackground(
color_provider->GetColor(kColorPipWindowTopBarBackground)));
@@ -772,7 +772,7 @@ void PictureInPictureBrowserFrameView::RemovedFromWidg
BrowserNonClientFrameView::RemovedFromWidget();
}
-#if BUILDFLAG(IS_LINUX)
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
gfx::Insets PictureInPictureBrowserFrameView::MirroredFrameBorderInsets()
const {
auto border = FrameBorderInsets();
@@ -1016,7 +1016,7 @@ void PictureInPictureBrowserFrameView::AnimationProgre
// views::View implementations:
void PictureInPictureBrowserFrameView::OnPaint(gfx::Canvas* canvas) {
-#if BUILDFLAG(IS_LINUX)
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
// Draw the PiP window frame borders and shadows, including the top bar
// background.
if (window_frame_provider_) {
@@ -1140,7 +1140,7 @@ void PictureInPictureBrowserFrameView::UpdateTopBarVie
}
gfx::Insets PictureInPictureBrowserFrameView::FrameBorderInsets() const {
-#if BUILDFLAG(IS_LINUX)
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
if (window_frame_provider_) {
const auto insets = window_frame_provider_->GetFrameThicknessDip();
const auto tiled_edges = frame()->tiled_edges();
@@ -1161,7 +1161,7 @@ gfx::Insets PictureInPictureBrowserFrameView::FrameBor
}
gfx::Insets PictureInPictureBrowserFrameView::ResizeBorderInsets() const {
-#if BUILDFLAG(IS_LINUX)
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
return FrameBorderInsets();
#elif BUILDFLAG(IS_CHROMEOS_ASH)
return gfx::Insets(chromeos::kResizeInsideBoundsSize);
@@ -1182,7 +1182,7 @@ gfx::Size PictureInPictureBrowserFrameView::GetNonClie
top_height + border_thickness.bottom());
}
-#if BUILDFLAG(IS_LINUX)
+#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_BSD)
void PictureInPictureBrowserFrameView::SetWindowFrameProvider(
ui::WindowFrameProvider* window_frame_provider) {
DCHECK(window_frame_provider);
|