![electron-roller[bot]](/assets/img/avatar_default.png)
* chore: bump chromium in DEPS to 140.0.7309.0 * 6762172: Replace MSG_ROUTING_NONE with IPC::mojom::kRoutingIdNone. Refs https://chromium-review.googlesource.com/c/chromium/src/+/6762172 * 6759543: [exit-time-destructors] Exclude target with warnings Refs https://chromium-review.googlesource.com/c/chromium/src/+/6759543 * 6765167: Split PreconnectManager into interface and implementation. Refs https://chromium-review.googlesource.com/c/chromium/src/+/6765167 * 6766775: [media] Clarify coded and visible size in FrameResources Refs https://chromium-review.googlesource.com/c/chromium/src/+/6766775 * 6760878: Move PreconnectRequest to //content/public Refs https://chromium-review.googlesource.com/c/chromium/src/+/6760878 * 6718973: Implement media playback trust check for the video PiP overlay window Refs https://chromium-review.googlesource.com/c/chromium/src/+/6718973 * chore: add missing include of <iterator> in ada * chore: update patches * chore: node gen-libc++-filenames.js * 6759633: [media] Use format from shared image in FrameResources Refs https://chromium-review.googlesource.com/c/chromium/src/+/6759633 --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
108 lines
4.7 KiB
Diff
108 lines
4.7 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 8168b4cfbafd42fa93a5aa9a3691c2552fabfb86..ba49212bd76d209f99c1cee649fc1466215a13c1 100644
|
|
--- a/chrome/browser/ui/views/overlay/close_image_button.cc
|
|
+++ b/chrome/browser/ui/views/overlay/close_image_button.cc
|
|
@@ -5,9 +5,12 @@
|
|
#include "chrome/browser/ui/views/overlay/close_image_button.h"
|
|
|
|
#include "base/feature_list.h"
|
|
+#include "build/branding_buildflags.h"
|
|
#include "chrome/browser/ui/color/chrome_color_id.h"
|
|
#include "chrome/grit/generated_resources.h"
|
|
+#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
|
|
#include "components/vector_icons/vector_icons.h"
|
|
+#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
|
|
#include "media/base/media_switches.h"
|
|
#include "ui/base/l10n/l10n_util.h"
|
|
#include "ui/base/metadata/metadata_impl_macros.h"
|
|
@@ -29,7 +32,10 @@ CloseImageButton::CloseImageButton(PressedCallback callback)
|
|
: OverlayWindowImageButton(std::move(callback)) {
|
|
SetSize(gfx::Size(kCloseButtonSize, kCloseButtonSize));
|
|
|
|
- auto* icon = &vector_icons::kCloseChromeRefreshIcon;
|
|
+ auto* icon = &views::kIcCloseIcon;
|
|
+#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
|
|
+ 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 6996fd43053f1da7b4e721e9c13cf62127c42ef2..6544da9c4554ca9c2a444f4f9d5896c24b65b358 100644
|
|
--- a/chrome/browser/ui/views/overlay/video_overlay_window_views.cc
|
|
+++ b/chrome/browser/ui/views/overlay/video_overlay_window_views.cc
|
|
@@ -18,12 +18,16 @@
|
|
#include "base/time/time.h"
|
|
#include "base/timer/timer.h"
|
|
#include "build/build_config.h"
|
|
+#if 0
|
|
#include "chrome/browser/media/media_engagement_service.h"
|
|
+#endif
|
|
#include "chrome/browser/picture_in_picture/picture_in_picture_occlusion_tracker.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_button.h"
|
|
#include "chrome/browser/ui/views/overlay/back_to_tab_label_button.h"
|
|
@@ -78,7 +82,7 @@
|
|
#include "ui/aura/window.h"
|
|
#endif
|
|
|
|
-#if BUILDFLAG(IS_WIN)
|
|
+#if 0
|
|
#include "chrome/browser/shell_integration_win.h"
|
|
#include "content/public/browser/render_widget_host_view.h"
|
|
#include "ui/aura/window.h"
|
|
@@ -433,7 +437,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::FindBrowserWithTab(controller->GetWebContents());
|
|
if (browser) {
|
|
@@ -1248,10 +1252,12 @@ void VideoOverlayWindowViews::SetUpViews() {
|
|
l10n_util::GetStringUTF16(
|
|
IDS_PICTURE_IN_PICTURE_LIVE_CAPTION_CONTROL_TEXT));
|
|
live_caption_button->SetSize(kActionButtonSize);
|
|
+#if 0
|
|
live_caption_dialog = std::make_unique<OverlayWindowLiveCaptionDialog>(
|
|
Profile::FromBrowserContext(
|
|
controller_->GetWebContents()->GetBrowserContext()));
|
|
live_caption_dialog->SetVisible(false);
|
|
+#endif
|
|
toggle_microphone_button =
|
|
std::make_unique<ToggleMicrophoneButton>(base::BindRepeating(
|
|
[](VideoOverlayWindowViews* overlay) {
|
|
@@ -2527,6 +2533,7 @@ gfx::Rect VideoOverlayWindowViews::GetLiveCaptionDialogBounds() {
|
|
|
|
bool VideoOverlayWindowViews::HasHighMediaEngagement(
|
|
const url::Origin& origin) const {
|
|
+#if 0
|
|
MediaEngagementService* service =
|
|
MediaEngagementService::Get(Profile::FromBrowserContext(
|
|
GetController()->GetWebContents()->GetBrowserContext()));
|
|
@@ -2535,6 +2542,8 @@ bool VideoOverlayWindowViews::HasHighMediaEngagement(
|
|
}
|
|
|
|
return service->HasHighEngagement(origin);
|
|
+#endif
|
|
+ return true;
|
|
}
|
|
|
|
bool VideoOverlayWindowViews::IsTrustedForMediaPlayback() const {
|