electron/patches/chromium/picture-in-picture.patch
electron-roller[bot] 9d0e6d09f0
chore: bump chromium to 119.0.6043.0 (main) (#40045)
* chore: bump chromium in DEPS to 119.0.6036.0

* chore: bump chromium in DEPS to 119.0.6037.0

* chore: bump chromium in DEPS to 119.0.6039.0

* chore: bump chromium in DEPS to 119.0.6041.0

* chore: update chromium patches

* 4765230: Move //content/browser/renderer_host/event_with_latency_info.h to //content/common/input | https://chromium-review.googlesource.com/c/chromium/src/+/4765230

* 4890325: ScopedRunLoopTimeout: add custom timeout callback handler for testing | https://chromium-review.googlesource.com/c/chromium/src/+/4890325

* chore: update all patches

* chore: bump chromium in DEPS to 119.0.6043.0

* 4898682: [api] Add Error.cause to V8 API

https://chromium-review.googlesource.com/c/v8/v8/+/4898682

* 4837192: Plumb origin through for drags.

https://chromium-review.googlesource.com/c/chromium/src/+/4837192

* Prevent content analysis on web pages that don't accept drag and drop.

https://chromium-review.googlesource.com/c/chromium/src/+/4814086

* Make getting displayed notifications work with notification attribution.

https://chromium-review.googlesource.com/c/chromium/src/+/4738935

* 4898682: [api] Add Error.cause to V8 API

https://chromium-review.googlesource.com/c/v8/v8/+/4898682

* lib,test: do not hardcode Buffer.kMaxLength

https://github.com/nodejs/node/pull/49876

* chore: remove Goma warning from mksnapshot_args

* 4776412: Remove Windows-specific wstring variants of StringPrintf() etc.

https://chromium-review.googlesource.com/c/chromium/src/+/4776412

* [dPWA] Prevent WebAppInstallInfo from being included on Android

https://chromium-review.googlesource.com/c/chromium/src/+/4886594

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: VerteDinde <vertedinde@electronjs.org>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
2023-10-02 18:01:07 -04:00

75 lines
3.3 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Heilig Benedek <benecene@gmail.com>
Date: Sat, 10 Aug 2019 00:41:50 +0200
Subject: feat: enable picture in picture mode for video players
These files are needed to implement PiP, but the Electron build patches out
chrome's generated resources for our own. This updates the #include so that we
don't get errors for Chrome's generated resources, which are non-existent
because we don't generate them in our build.
diff --git a/chrome/browser/ui/views/overlay/close_image_button.cc b/chrome/browser/ui/views/overlay/close_image_button.cc
index af0616d9ca466d146f3c41887857dd4720ebafbf..c088db193f5bd4b88aa42a3803571d2b87251b76 100644
--- a/chrome/browser/ui/views/overlay/close_image_button.cc
+++ b/chrome/browser/ui/views/overlay/close_image_button.cc
@@ -4,11 +4,14 @@
#include "chrome/browser/ui/views/overlay/close_image_button.h"
+#include "build/branding_buildflags.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/ui/color/chrome_color_id.h"
#include "chrome/grit/generated_resources.h"
+#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
#include "components/omnibox/browser/omnibox_field_trial.h"
#include "components/vector_icons/vector_icons.h"
+#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/base/models/image_model.h"
@@ -28,9 +31,11 @@ CloseImageButton::CloseImageButton(PressedCallback callback)
SetSize(gfx::Size(kCloseButtonSize, kCloseButtonSize));
auto* icon = &views::kIcCloseIcon;
+#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
if (OmniboxFieldTrial::IsChromeRefreshIconsEnabled()) {
icon = &vector_icons::kCloseChromeRefreshIcon;
}
+#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
SetImageModel(views::Button::STATE_NORMAL,
ui::ImageModel::FromVectorIcon(*icon, kColorPipWindowForeground,
kCloseButtonIconSize));
diff --git a/chrome/browser/ui/views/overlay/video_overlay_window_views.cc b/chrome/browser/ui/views/overlay/video_overlay_window_views.cc
index 50c222d235461ecce1f3ccc8941293de41cc134c..88d2338f7b6fb4fded4c34105bb7f52fc35f06a1 100644
--- a/chrome/browser/ui/views/overlay/video_overlay_window_views.cc
+++ b/chrome/browser/ui/views/overlay/video_overlay_window_views.cc
@@ -16,9 +16,11 @@
#include "base/timer/timer.h"
#include "build/build_config.h"
#include "chrome/browser/picture_in_picture/picture_in_picture_window_manager.h"
+#if 0
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
+#endif
#include "chrome/browser/ui/color/chrome_color_id.h"
#include "chrome/browser/ui/views/overlay/back_to_tab_label_button.h"
#include "chrome/browser/ui/views/overlay/close_image_button.h"
@@ -55,7 +57,7 @@
#include "ui/aura/window.h"
#endif
-#if BUILDFLAG(IS_WIN)
+#if 0
#include "chrome/browser/shell_integration_win.h"
#include "ui/aura/window.h"
#include "ui/aura/window_tree_host.h"
@@ -276,7 +278,7 @@ std::unique_ptr<VideoOverlayWindowViews> VideoOverlayWindowViews::Create(
overlay_window->Init(std::move(params));
overlay_window->OnRootViewReady();
-#if BUILDFLAG(IS_WIN)
+#if 0
std::wstring app_user_model_id;
Browser* browser =
chrome::FindBrowserWithWebContents(controller->GetWebContents());