// Copyright 2021 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef COMPONENTS_CONTENT_CAPTURE_BROWSER_CONTENT_CAPTURE_CONSUMER_H_ #define COMPONENTS_CONTENT_CAPTURE_BROWSER_CONTENT_CAPTURE_CONSUMER_H_ #include <vector> #include "components/content_capture/browser/content_capture_frame.h" class GURL; namespace content_capture { // The interface for the embedder to get onscreen content. // // The embedder shall call OnscreenContentProvider::AddConsumer() to add // itself as consumer. // // OnscreenContentProvider* provider = // OnscreenContentProvider::FromWebContents(web_contents); // if (!provider) // provider = OnscreenContentProvider::Create(web_contents); // provider->AddConsumer(*this); // // The embedder might remove itself when the onscreen content is no longer // needed. // // Keep the weak reference // onscreen_content_provider_ = provider->GetWeakPtr(); // // // Remove from the consumers // if (auto* provider = onscreen_content_provider_.get()) // provider->RemoveConsumer(*this); class ContentCaptureConsumer { … }; } // namespace content_capture #endif // COMPONENTS_CONTENT_CAPTURE_BROWSER_CONTENT_CAPTURE_CONSUMER_H_