mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fixup 5186276: [autopip] Make "allow once" per navigation
https://chromium-review.googlesource.com/c/chromium/src/+/5186276
This commit is contained in:
@@ -67,64 +67,6 @@ index fd46d3ce5f0d0beed2736186bbc1ff41ec93fdeb..e6765df12b5e79ea0e1eecc1805447f4
|
||||
}
|
||||
|
||||
PictureInPictureOcclusionTracker*
|
||||
diff --git a/chrome/browser/picture_in_picture/picture_in_picture_window_manager.h b/chrome/browser/picture_in_picture/picture_in_picture_window_manager.h
|
||||
index a08e72b1e35f6393ce4019698ba993495f04643d..5a53dc17c163dba1fd048a8016aa7591c492c43b 100644
|
||||
--- a/chrome/browser/picture_in_picture/picture_in_picture_window_manager.h
|
||||
+++ b/chrome/browser/picture_in_picture/picture_in_picture_window_manager.h
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "base/memory/singleton.h"
|
||||
#include "base/observer_list.h"
|
||||
#include "base/observer_list_types.h"
|
||||
+#include "build/branding_buildflags.h"
|
||||
#include "build/build_config.h"
|
||||
#include "third_party/blink/public/mojom/picture_in_picture_window_options/picture_in_picture_window_options.mojom.h"
|
||||
#include "ui/gfx/geometry/rect.h"
|
||||
@@ -33,6 +34,9 @@ class Display;
|
||||
} // namespace display
|
||||
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
+#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
|
||||
+class AutoPipSettingHelper;
|
||||
+#endif
|
||||
class PictureInPictureOcclusionTracker;
|
||||
|
||||
namespace views {
|
||||
@@ -179,6 +183,11 @@ class PictureInPictureWindowManager {
|
||||
const gfx::Rect& browser_view_overridden_bounds,
|
||||
views::View* anchor_view,
|
||||
views::BubbleBorder::Arrow arrow);
|
||||
+#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
|
||||
+ AutoPipSettingHelper* get_setting_helper_for_testing() {
|
||||
+ return auto_pip_setting_helper_.get();
|
||||
+ }
|
||||
+#endif
|
||||
|
||||
// Returns the PictureInPictureOcclusionTracker, which can inform observers
|
||||
// when a widget has been occluded by a video or document picture-in-picture
|
||||
@@ -240,6 +249,11 @@ class PictureInPictureWindowManager {
|
||||
static void ExitPictureInPictureSoon();
|
||||
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
+#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
|
||||
+ // Create the settings helper if this is auto-pip and we don't have one.
|
||||
+ void CreateAutoPipSettingHelperIfNeeded();
|
||||
+#endif
|
||||
+
|
||||
// Creates the `occlusion_tracker_` if it does not already exist and should
|
||||
// exist.
|
||||
void CreateOcclusionTrackerIfNecessary();
|
||||
@@ -255,9 +269,10 @@ class PictureInPictureWindowManager {
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
std::unique_ptr<DocumentWebContentsObserver> document_web_contents_observer_;
|
||||
|
||||
+#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
|
||||
+
|
||||
std::unique_ptr<PictureInPictureOcclusionTracker> occlusion_tracker_;
|
||||
#endif //! BUILDFLAG(IS_ANDROID)
|
||||
-
|
||||
raw_ptr<content::PictureInPictureWindowController, DanglingUntriaged>
|
||||
pip_window_controller_ = nullptr;
|
||||
};
|
||||
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 b3419d2bb60ab0488fc0413843c33b5a926fee09..059754d92621ada9100e739ee6b5db01ae9ea75f 100644
|
||||
--- a/chrome/browser/ui/views/overlay/video_overlay_window_views.cc
|
||||
|
||||
Reference in New Issue
Block a user