Skip to content

Commit

Permalink
fixup 5186276: [autopip] Make "allow once" per navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
jkleinsc committed Jan 25, 2024
1 parent a1f643b commit e3c40ed
Showing 1 changed file with 0 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e3c40ed

Please sign in to comment.