#include "chrome/browser/extensions/api/tab_capture/tab_capture_registry.h"
#include <memory>
#include <utility>
#include "base/lazy_instance.h"
#include "base/memory/raw_ptr.h"
#include "base/values.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "components/sessions/content/session_tab_helper.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/desktop_streams_registry.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_observer.h"
#include "extensions/browser/event_router.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_id.h"
#include "url/origin.h"
BrowserThread;
TabCaptureState;
namespace extensions {
tab_capture;
class TabCaptureRegistry::LiveRequest : public content::WebContentsObserver { … };
TabCaptureRegistry::TabCaptureRegistry(content::BrowserContext* context)
: … { … }
TabCaptureRegistry::~TabCaptureRegistry() { … }
TabCaptureRegistry* TabCaptureRegistry::Get(content::BrowserContext* context) { … }
static base::LazyInstance<BrowserContextKeyedAPIFactory<TabCaptureRegistry>>::
DestructorAtExit g_tab_capture_registry_factory = …;
BrowserContextKeyedAPIFactory<TabCaptureRegistry>*
TabCaptureRegistry::GetFactoryInstance() { … }
void TabCaptureRegistry::GetCapturedTabs(
const std::string& extension_id,
base::Value::List* capture_info_list) const { … }
void TabCaptureRegistry::OnExtensionUnloaded(
content::BrowserContext* browser_context,
const Extension* extension,
UnloadedExtensionReason reason) { … }
std::string TabCaptureRegistry::AddRequest(
content::WebContents* target_contents,
const std::string& extension_id,
bool is_anonymous,
const GURL& origin,
content::DesktopMediaID source,
int caller_render_process_id,
std::optional<int> restrict_to_render_frame_id) { … }
bool TabCaptureRegistry::VerifyRequest(int render_process_id,
int render_frame_id,
const std::string& extension_id) { … }
void TabCaptureRegistry::OnRequestUpdate(
int target_render_process_id,
int target_render_frame_id,
blink::mojom::MediaStreamType stream_type,
const content::MediaRequestState new_state) { … }
void TabCaptureRegistry::DispatchStatusChangeEvent(
const LiveRequest* request) const { … }
TabCaptureRegistry::LiveRequest* TabCaptureRegistry::FindRequest(
const content::WebContents* target_contents) const { … }
TabCaptureRegistry::LiveRequest* TabCaptureRegistry::FindRequest(
int target_render_process_id,
int target_render_frame_id) const { … }
void TabCaptureRegistry::KillRequest(LiveRequest* request) { … }
}