2018-10-24 18:24:11 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: deepak1556 <hop2deep@gmail.com>
|
|
|
|
Date: Thu, 18 Oct 2018 17:07:01 -0700
|
|
|
|
Subject: desktop_media_list.patch
|
|
|
|
|
2021-09-03 23:37:36 +00:00
|
|
|
* Use our grit resources instead of the chrome ones.
|
2021-08-24 00:52:17 +00:00
|
|
|
* Disabled WindowCaptureMacV2 feature for https://github.com/electron/electron/pull/30507
|
2021-11-30 23:12:39 +00:00
|
|
|
* Ensure "OnRefreshComplete()" even if there are no items in the list
|
2021-05-18 22:44:46 +00:00
|
|
|
|
2018-10-03 12:26:42 +00:00
|
|
|
diff --git a/chrome/browser/media/webrtc/desktop_media_list.h b/chrome/browser/media/webrtc/desktop_media_list.h
|
2021-10-21 18:51:36 +00:00
|
|
|
index 57cfc646f8ea545271c22d79ec158a04b148bc9c..db4d608d3bed841ddf7225d0918e82112c8d08b5 100644
|
2018-10-03 12:26:42 +00:00
|
|
|
--- a/chrome/browser/media/webrtc/desktop_media_list.h
|
|
|
|
+++ b/chrome/browser/media/webrtc/desktop_media_list.h
|
2021-10-21 18:51:36 +00:00
|
|
|
@@ -94,7 +94,7 @@ class DesktopMediaList {
|
2021-09-03 23:37:36 +00:00
|
|
|
// once per DesktopMediaList instance. It should not be called after
|
|
|
|
// StartUpdating(), and StartUpdating() should not be called until |callback|
|
|
|
|
// has been called.
|
|
|
|
- virtual void Update(UpdateCallback callback) = 0;
|
|
|
|
+ virtual void Update(UpdateCallback callback, bool fetch_thumbnails = false) = 0;
|
2018-10-03 12:26:42 +00:00
|
|
|
|
|
|
|
virtual int GetSourceCount() const = 0;
|
|
|
|
virtual const Source& GetSource(int index) const = 0;
|
|
|
|
diff --git a/chrome/browser/media/webrtc/desktop_media_list_base.cc b/chrome/browser/media/webrtc/desktop_media_list_base.cc
|
2021-10-21 18:51:36 +00:00
|
|
|
index 24bd95b79479c21182a0d1a61364e1794f900261..2b2a7494ee9bd88fd5c8ebf50a5e29738b2dffd0 100644
|
2018-10-03 12:26:42 +00:00
|
|
|
--- a/chrome/browser/media/webrtc/desktop_media_list_base.cc
|
|
|
|
+++ b/chrome/browser/media/webrtc/desktop_media_list_base.cc
|
2021-10-21 18:51:36 +00:00
|
|
|
@@ -63,12 +63,12 @@ void DesktopMediaListBase::StartUpdating(DesktopMediaListObserver* observer) {
|
2021-09-03 23:37:36 +00:00
|
|
|
Refresh(true);
|
|
|
|
}
|
2019-10-28 22:12:35 +00:00
|
|
|
|
2021-09-03 23:37:36 +00:00
|
|
|
-void DesktopMediaListBase::Update(UpdateCallback callback) {
|
|
|
|
+void DesktopMediaListBase::Update(UpdateCallback callback, bool refresh_thumbnails) {
|
2021-10-21 18:51:36 +00:00
|
|
|
DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
2019-10-18 19:57:34 +00:00
|
|
|
DCHECK(sources_.empty());
|
|
|
|
DCHECK(!refresh_callback_);
|
|
|
|
refresh_callback_ = std::move(callback);
|
|
|
|
- Refresh(false);
|
2021-09-03 23:37:36 +00:00
|
|
|
+ Refresh(refresh_thumbnails);
|
2018-10-03 12:26:42 +00:00
|
|
|
}
|
|
|
|
|
2019-10-18 19:57:34 +00:00
|
|
|
int DesktopMediaListBase::GetSourceCount() const {
|
2018-10-03 12:26:42 +00:00
|
|
|
diff --git a/chrome/browser/media/webrtc/desktop_media_list_base.h b/chrome/browser/media/webrtc/desktop_media_list_base.h
|
2021-10-21 18:51:36 +00:00
|
|
|
index 98cc4e039ba2b5a467175b15650a7b8ef38e8249..f5aea6a5916b9aa56ee7b81a8de97dc44e04a759 100644
|
2018-10-03 12:26:42 +00:00
|
|
|
--- a/chrome/browser/media/webrtc/desktop_media_list_base.h
|
|
|
|
+++ b/chrome/browser/media/webrtc/desktop_media_list_base.h
|
2021-10-06 02:21:00 +00:00
|
|
|
@@ -35,7 +35,7 @@ class DesktopMediaListBase : public DesktopMediaList {
|
2019-10-28 22:12:35 +00:00
|
|
|
void SetThumbnailSize(const gfx::Size& thumbnail_size) override;
|
|
|
|
void SetViewDialogWindowId(content::DesktopMediaID dialog_id) override;
|
2021-09-03 23:37:36 +00:00
|
|
|
void StartUpdating(DesktopMediaListObserver* observer) override;
|
|
|
|
- void Update(UpdateCallback callback) override;
|
|
|
|
+ void Update(UpdateCallback callback, bool refresh_thumbnails) override;
|
2018-10-03 12:26:42 +00:00
|
|
|
int GetSourceCount() const override;
|
|
|
|
const Source& GetSource(int index) const override;
|
2021-03-04 23:46:13 +00:00
|
|
|
DesktopMediaList::Type GetMediaListType() const override;
|
2018-10-03 12:26:42 +00:00
|
|
|
diff --git a/chrome/browser/media/webrtc/native_desktop_media_list.cc b/chrome/browser/media/webrtc/native_desktop_media_list.cc
|
2021-11-30 23:12:39 +00:00
|
|
|
index f777d8e6aa8a36d273a1a23f5e71390fad7e434f..c59706f0e244afa9408a5bfeaf5a51ad10c1f885 100644
|
2018-10-03 12:26:42 +00:00
|
|
|
--- a/chrome/browser/media/webrtc/native_desktop_media_list.cc
|
|
|
|
+++ b/chrome/browser/media/webrtc/native_desktop_media_list.cc
|
2021-09-03 23:37:36 +00:00
|
|
|
@@ -16,7 +16,7 @@
|
2020-10-28 00:33:04 +00:00
|
|
|
#include "base/threading/thread_task_runner_handle.h"
|
2018-10-24 23:25:48 +00:00
|
|
|
#include "build/build_config.h"
|
2019-10-18 19:57:34 +00:00
|
|
|
#include "chrome/browser/media/webrtc/desktop_media_list.h"
|
2018-10-03 20:50:07 +00:00
|
|
|
-#include "chrome/grit/generated_resources.h"
|
2021-09-03 23:37:36 +00:00
|
|
|
+#include "electron/grit/electron_resources.h"
|
2019-01-12 01:00:43 +00:00
|
|
|
#include "content/public/browser/browser_task_traits.h"
|
2018-10-03 12:26:42 +00:00
|
|
|
#include "content/public/browser/browser_thread.h"
|
2021-03-15 18:32:18 +00:00
|
|
|
#include "content/public/common/content_features.h"
|
2021-11-24 08:45:59 +00:00
|
|
|
@@ -94,8 +94,9 @@ gfx::ImageSkia ScaleDesktopFrame(std::unique_ptr<webrtc::DesktopFrame> frame,
|
2021-08-24 00:52:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#if defined(OS_MAC)
|
|
|
|
+// Refs https://github.com/electron/electron/pull/30507
|
|
|
|
const base::Feature kWindowCaptureMacV2{"WindowCaptureMacV2",
|
2021-11-24 08:45:59 +00:00
|
|
|
- base::FEATURE_ENABLED_BY_DEFAULT};
|
|
|
|
+ base::FEATURE_DISABLED_BY_DEFAULT};
|
2021-08-24 00:52:17 +00:00
|
|
|
#endif
|
2021-11-24 08:45:59 +00:00
|
|
|
|
|
|
|
} // namespace
|
2021-11-30 23:12:39 +00:00
|
|
|
@@ -427,6 +428,11 @@ void NativeDesktopMediaList::RefreshForVizFrameSinkWindows(
|
2021-09-03 23:37:36 +00:00
|
|
|
FROM_HERE, base::BindOnce(&Worker::RefreshThumbnails,
|
|
|
|
base::Unretained(worker_.get()),
|
|
|
|
std::move(native_ids), thumbnail_size_));
|
|
|
|
+ } else {
|
2021-11-30 23:12:39 +00:00
|
|
|
+#if defined(USE_AURA)
|
|
|
|
+ pending_native_thumbnail_capture_ = true;
|
|
|
|
+#endif
|
|
|
|
+ UpdateNativeThumbnailsFinished();
|
2021-09-03 23:37:36 +00:00
|
|
|
}
|
2019-09-18 20:20:41 +00:00
|
|
|
}
|
|
|
|
|