chromium/chrome/browser/ui/views/desktop_capture/desktop_media_tab_list.cc

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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 {

// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
enum class HighlightedTabDiscardStatus {};

// Max stored length for the title of a previewed tab. The actual displayed
// length is likely shorter than this, as the Label will elide it to fit the UI.
constexpr const int kMaxPreviewTitleLength =;

// TODO(crbug.com/40187992): Refer to central Desktop UI constants rather than
// hardcoding this.
const int kListWidth =;

// Delay after the selection is changed before clearing the preview, to allow a
// direct switch from the old preview to the new one without flashing grey in
// between.
const base::TimeDelta kClearPreviewDelay =;

// ui::TableModel that wraps a DesktopMediaListController and listens for
// updates from it.
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() {}

// TableViewObserver implementation that bridges between the actual TableView
// listing tabs and the DesktopMediaTabList.
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) {}

}  // namespace

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()