#include "chrome/browser/extensions/api/tab_capture/tab_capture_api.h"
#include <algorithm>
#include <set>
#include <string>
#include <utility>
#include <vector>
#include "base/command_line.h"
#include "base/strings/string_util.h"
#include "base/values.h"
#include "chrome/browser/extensions/api/tab_capture/tab_capture_registry.h"
#include "chrome/browser/extensions/extension_tab_util.h"
#include "chrome/browser/media/webrtc/capture_policy_utils.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_switches.h"
#include "components/sessions/content/session_tab_helper.h"
#include "content/public/browser/desktop_media_id.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 "extensions/common/features/feature.h"
#include "extensions/common/features/feature_provider.h"
#include "extensions/common/features/simple_feature.h"
#include "extensions/common/permissions/permissions_data.h"
#include "extensions/common/switches.h"
#include "net/base/url_util.h"
#include "services/network/public/cpp/is_potentially_trustworthy.h"
DesktopMediaID;
WebContentsMediaCaptureId;
MediaStreamConstraint;
TabCapture;
GetCapturedTabs;
namespace extensions {
namespace {
const char kCapturingSameTab[] = …;
const char kFindingTabError[] = …;
const char kNoAudioOrVideo[] = …;
const char kGrantError[] = …;
const char kInvalidOriginError[] = …;
const char kInvalidTabIdError[] = …;
const char kTabUrlNotSecure[] = …;
const char kMediaStreamSource[] = …;
const char kMediaStreamSourceId[] = …;
const char kMediaStreamSourceTab[] = …;
bool OptionsSpecifyAudioOrVideo(const TabCapture::CaptureOptions& options) { … }
DesktopMediaID BuildDesktopMediaID(content::WebContents* target_contents,
TabCapture::CaptureOptions* options) { … }
void AddMediaStreamSourceConstraints(content::WebContents* target_contents,
TabCapture::CaptureOptions* options,
const std::string& device_id) { … }
Browser* GetLastActiveBrowser(const Profile* profile,
const bool match_incognito_profile) { … }
std::string GetAllowlistedExtensionID() { … }
}
ExtensionFunction::ResponseAction TabCaptureCaptureFunction::Run() { … }
ExtensionFunction::ResponseAction TabCaptureGetCapturedTabsFunction::Run() { … }
ExtensionFunction::ResponseAction TabCaptureGetMediaStreamIdFunction::Run() { … }
}