#include "chrome/browser/ui/views/desktop_capture/share_this_tab_dialog_views.h"
#include "base/command_line.h"
#include "base/metrics/histogram_functions.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "build/config/chromebox_for_meetings/buildflags.h"
#include "chrome/browser/media/webrtc/desktop_media_list.h"
#include "chrome/browser/media/webrtc/desktop_media_picker_manager.h"
#include "chrome/browser/media/webrtc/desktop_media_picker_utils.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/color/chrome_color_id.h"
#include "chrome/browser/ui/extensions/extensions_container.h"
#include "chrome/browser/ui/layout_constants.h"
#include "chrome/browser/ui/views/chrome_layout_provider.h"
#include "chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.h"
#include "chrome/browser/ui/views/desktop_capture/share_this_tab_source_view.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/grit/generated_resources.h"
#include "components/constrained_window/constrained_window_views.h"
#include "components/vector_icons/vector_icons.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/desktop_media_id.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents_delegate.h"
#include "media/base/media_switches.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/base/mojom/dialog_button.mojom.h"
#include "ui/base/mojom/ui_base_types.mojom-shared.h"
#include "ui/base/ui_base_features.h"
#include "ui/color/color_id.h"
#include "ui/gfx/color_palette.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/background.h"
#include "ui/views/border.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/style/typography.h"
#include "ui/views/style/typography_provider.h"
#include "ui/views/view_class_properties.h"
#include "ui/views/widget/widget.h"
#if defined(USE_AURA)
#include "ui/aura/window_tree_host.h"
#endif
namespace {
constexpr int kTitleTopMargin = …;
constexpr gfx::Insets kAudioToggleInsets = …;
constexpr int kAudioToggleChildSpacing = …;
void RecordUmaCancellation(base::TimeTicks dialog_open_time) { … }
void RecordUmaSelection(base::TimeTicks dialog_open_time) { … }
const base::FeatureParam<int> kShareThisTabDialogActivationDelayMs{ … };
bool ShouldAutoAcceptThisTabCapture() { … }
}
ShareThisTabDialogView::ShareThisTabDialogView(
const DesktopMediaPicker::Params& params,
ShareThisTabDialogViews* parent)
: … { … }
ShareThisTabDialogView::~ShareThisTabDialogView() = default;
void ShareThisTabDialogView::RecordUmaDismissal() const { … }
void ShareThisTabDialogView::DetachParent() { … }
gfx::Size ShareThisTabDialogView::CalculatePreferredSize(
const views::SizeBounds& ) const { … }
bool ShareThisTabDialogView::ShouldShowWindowTitle() const { … }
bool ShareThisTabDialogView::Accept() { … }
bool ShareThisTabDialogView::Cancel() { … }
bool ShareThisTabDialogView::ShouldShowCloseButton() const { … }
void ShareThisTabDialogView::SetupSourceView() { … }
void ShareThisTabDialogView::SetupAudioToggle() { … }
void ShareThisTabDialogView::Activate() { … }
bool ShareThisTabDialogView::ShouldAutoAccept() const { … }
bool ShareThisTabDialogView::ShouldAutoReject() const { … }
BEGIN_METADATA(…)
ShareThisTabDialogViews::ShareThisTabDialogViews() : … { … }
ShareThisTabDialogViews::~ShareThisTabDialogViews() { … }
void ShareThisTabDialogViews::Show(
const DesktopMediaPicker::Params& params,
std::vector<std::unique_ptr<DesktopMediaList>> source_lists,
DoneCallback done_callback) { … }
void ShareThisTabDialogViews::NotifyDialogResult(
const content::DesktopMediaID& source) { … }