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

// Copyright 2016 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_list_view.h"

#include <algorithm>
#include <string>
#include <utility>

#include "base/ranges/algorithm.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/media/webrtc/desktop_media_list.h"
#include "chrome/browser/media/webrtc/window_icon_util.h"
#include "chrome/browser/ui/views/desktop_capture/desktop_media_picker_views.h"
#include "chrome/browser/ui/views/desktop_capture/desktop_media_source_view.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/grit/theme_resources.h"
#include "extensions/grit/extensions_browser_resources.h"
#include "ui/accessibility/ax_enums.mojom.h"
#include "ui/accessibility/ax_node_data.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/views/accessibility/view_accessibility.h"
#include "ui/views/view_utils.h"

#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "ui/aura/window.h"
#endif

DesktopMediaID;

namespace {

const int kDesktopMediaSourceViewGroupId =;

#if BUILDFLAG(IS_CHROMEOS_ASH)
// Here we are going to display default app icon for app windows without an
// icon, and display product logo for chrome browser windows.
gfx::ImageSkia LoadDefaultIcon(aura::Window* window) {
  BrowserView* browser_view =
      BrowserView::GetBrowserViewForNativeWindow(window);
  Browser* browser = browser_view ? browser_view->browser() : nullptr;

  // Apps could be launched in a view other than BrowserView, so we count those
  // windows without Browser association as apps.
  // Technically dev tool is actually a special app, but we would like to
  // display product logo for it, because intuitively it is internal to browser.
  bool is_app =
      !browser || browser->is_type_app() || browser->is_type_app_popup();
  int idr = is_app ? IDR_APP_DEFAULT_ICON : IDR_PRODUCT_LOGO_32;

  ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
  return *rb.GetImageSkiaNamed(idr);
}
#endif

DesktopMediaSourceView* AsDesktopMediaSourceView(views::View* view) {}

}  // namespace

DesktopMediaListView::DesktopMediaListView(
    DesktopMediaListController* controller,
    DesktopMediaSourceViewStyle generic_style,
    DesktopMediaSourceViewStyle single_style,
    const std::u16string& accessible_name)
    :{}

DesktopMediaListView::~DesktopMediaListView() {}

void DesktopMediaListView::OnSelectionChanged() {}

gfx::Size DesktopMediaListView::CalculatePreferredSize(
    const views::SizeBounds& /*available_size*/) const {}

void DesktopMediaListView::Layout(PassKey) {}

bool DesktopMediaListView::OnKeyPressed(const ui::KeyEvent& event) {}

std::optional<content::DesktopMediaID> DesktopMediaListView::GetSelection() {}

DesktopMediaListController::SourceListListener*
DesktopMediaListView::GetSourceListListener() {}

void DesktopMediaListView::ClearSelection() {}

void DesktopMediaListView::OnSourceAdded(size_t index) {}

void DesktopMediaListView::OnSourceRemoved(size_t index) {}

void DesktopMediaListView::OnSourceMoved(size_t old_index, size_t new_index) {}

void DesktopMediaListView::OnSourceNameChanged(size_t index) {}

void DesktopMediaListView::OnSourceThumbnailChanged(size_t index) {}

void DesktopMediaListView::OnSourcePreviewChanged(size_t index) {}

void DesktopMediaListView::OnDelegatedSourceListSelection() {}

void DesktopMediaListView::SetStyle(DesktopMediaSourceViewStyle* style) {}

DesktopMediaSourceView* DesktopMediaListView::GetSelectedView() {}