#include "chrome/browser/ui/views/desktop_capture/desktop_media_tab_list.h"
#include "base/memory/raw_ptr.h"
#include "base/numerics/safe_conversions.h"
#include "base/task/sequenced_task_runner.h"
#include "chrome/browser/media/webrtc/desktop_media_list_layout_config.h"
#include "chrome/browser/ui/color/chrome_color_id.h"
#include "chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.h"
#include "chrome/grit/generated_resources.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/web_contents.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/color/color_provider.h"
#include "ui/gfx/favicon_size.h"
#include "ui/gfx/geometry/rounded_corners_f.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/background.h"
#include "ui/views/border.h"
#include "ui/views/controls/scroll_view.h"
#include "ui/views/controls/table/table_view.h"
#include "ui/views/controls/table/table_view_observer.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/layout/fill_layout.h"
#include "ui/views/layout/layout_provider.h"
#include "ui/views/view.h"
BrowserThread;
RenderFrameHost;
WebContents;
namespace {
enum class HighlightedTabDiscardStatus { … };
constexpr const int kMaxPreviewTitleLength = …;
const int kListWidth = …;
const base::TimeDelta kClearPreviewDelay = …;
class TabListModel : public ui::TableModel,
public DesktopMediaListController::SourceListListener { … };
TabListModel::TabListModel(
DesktopMediaListController* controller,
base::RepeatingCallback<void(size_t)> preview_updated_callback)
: … { … }
size_t TabListModel::RowCount() { … }
std::u16string TabListModel::GetText(size_t row, int column) { … }
ui::ImageModel TabListModel::GetIcon(size_t row) { … }
void TabListModel::SetObserver(ui::TableModelObserver* observer) { … }
void TabListModel::OnSourceAdded(size_t index) { … }
void TabListModel::OnSourceRemoved(size_t index) { … }
void TabListModel::OnSourceMoved(size_t old_index, size_t new_index) { … }
void TabListModel::OnSourceNameChanged(size_t index) { … }
void TabListModel::OnSourceThumbnailChanged(size_t index) { … }
void TabListModel::OnSourcePreviewChanged(size_t index) { … }
void TabListModel::OnDelegatedSourceListSelection() { … }
class TabListViewObserver : public views::TableViewObserver { … };
TabListViewObserver::TabListViewObserver(
DesktopMediaListController* controller,
base::RepeatingClosure selection_changed_callback)
: … { … }
void TabListViewObserver::OnSelectionChanged() { … }
void TabListViewObserver::OnKeyDown(ui::KeyboardCode virtual_keycode) { … }
std::unique_ptr<views::ScrollView> CreateScrollViewWithTable(
std::unique_ptr<views::TableView> table) { … }
}
DesktopMediaTabList::DesktopMediaTabList(DesktopMediaListController* controller,
const std::u16string& accessible_name)
: … { … }
std::unique_ptr<views::View> DesktopMediaTabList::BuildUI(
std::unique_ptr<views::TableView> table) { … }
DesktopMediaTabList::~DesktopMediaTabList() { … }
gfx::Size DesktopMediaTabList::CalculatePreferredSize(
const views::SizeBounds& available_size) const { … }
void DesktopMediaTabList::OnThemeChanged() { … }
std::optional<content::DesktopMediaID> DesktopMediaTabList::GetSelection() { … }
DesktopMediaListController::SourceListListener*
DesktopMediaTabList::GetSourceListListener() { … }
void DesktopMediaTabList::ClearSelection() { … }
void DesktopMediaTabList::ClearPreview() { … }
void DesktopMediaTabList::OnSelectionChanged() { … }
void DesktopMediaTabList::ClearPreviewImageIfUnchanged(
size_t previous_preview_set_count) { … }
void DesktopMediaTabList::OnPreviewUpdated(size_t index) { … }
void DesktopMediaTabList::RecordSourceDiscardedStatus(
const DesktopMediaList::Source& source) { … }
BEGIN_METADATA(…)