#include "chrome/browser/ui/thumbnails/thumbnail_tab_helper.h"
#include <stdint.h>
#include <algorithm>
#include <optional>
#include <set>
#include <utility>
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/metrics/histogram_macros.h"
#include "base/no_destructor.h"
#include "chrome/browser/ui/tabs/tab_style.h"
#include "chrome/browser/ui/thumbnails/background_thumbnail_video_capturer.h"
#include "chrome/browser/ui/thumbnails/thumbnail_capture_driver.h"
#include "chrome/browser/ui/thumbnails/thumbnail_readiness_tracker.h"
#include "chrome/browser/ui/thumbnails/thumbnail_scheduler.h"
#include "chrome/browser/ui/thumbnails/thumbnail_scheduler_impl.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_widget_host.h"
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/web_contents.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/geometry/skia_conversions.h"
#include "ui/native_theme/native_theme.h"
namespace …
enum class ThumbnailTabHelper::CaptureType { … };
class ThumbnailTabHelper::TabStateTracker
: public content::WebContentsObserver,
public ThumbnailCaptureDriver::Client,
public ThumbnailImage::Delegate { … };
void ThumbnailTabHelper::CaptureThumbnailOnTabBackgrounded() { … }
ThumbnailTabHelper::ThumbnailTabHelper(content::WebContents* contents)
: … { … }
ThumbnailTabHelper::~ThumbnailTabHelper() { … }
ThumbnailScheduler& ThumbnailTabHelper::GetScheduler() { … }
void ThumbnailTabHelper::StoreThumbnailForTabSwitch(base::TimeTicks start_time,
const SkBitmap& bitmap) { … }
void ThumbnailTabHelper::StoreThumbnailForBackgroundCapture(
const SkBitmap& bitmap,
uint64_t frame_id) { … }
void ThumbnailTabHelper::StoreThumbnail(CaptureType type,
const SkBitmap& bitmap,
std::optional<uint64_t> frame_id) { … }
void ThumbnailTabHelper::ClearData() { … }
void ThumbnailTabHelper::StartVideoCapture() { … }
void ThumbnailTabHelper::StopVideoCapture() { … }
ThumbnailCaptureInfo ThumbnailTabHelper::GetInitialCaptureInfo(
const gfx::Size& source_size,
float scale_factor,
bool include_scrollbars_in_capture) { … }
void ThumbnailTabHelper::AboutToBeDiscarded(
content::WebContents* new_contents) { … }
void ThumbnailTabHelper::DidStartNavigation(
content::NavigationHandle* navigation_handle) { … }
WEB_CONTENTS_USER_DATA_KEY_IMPL(ThumbnailTabHelper);