#include "extensions/renderer/content_watcher.h"
#include <stddef.h>
#include <set>
#include <string_view>
#include "base/memory/raw_ref.h"
#include "content/public/renderer/render_frame.h"
#include "content/public/renderer/render_frame_observer.h"
#include "content/public/renderer/render_frame_observer_tracker.h"
#include "content/public/renderer/render_frame_visitor.h"
#include "extensions/renderer/extension_frame_helper.h"
#include "third_party/blink/public/web/web_document.h"
#include "third_party/blink/public/web/web_element.h"
#include "third_party/blink/public/web/web_local_frame.h"
#include "third_party/blink/public/web/web_view.h"
namespace extensions {
namespace {
class FrameContentWatcher
: public content::RenderFrameObserver,
public content::RenderFrameObserverTracker<FrameContentWatcher> { … };
FrameContentWatcher::FrameContentWatcher(
content::RenderFrame* render_frame,
const blink::WebVector<blink::WebString>& css_selectors)
: … { … }
FrameContentWatcher::~FrameContentWatcher() = default;
void FrameContentWatcher::OnDestruct() { … }
void FrameContentWatcher::DidCreateDocumentElement() { … }
void FrameContentWatcher::DidMatchCSS(
const blink::WebVector<blink::WebString>& newly_matching_selectors,
const blink::WebVector<blink::WebString>& stopped_matching_selectors) { … }
void FrameContentWatcher::UpdateCSSSelectors(
const blink::WebVector<blink::WebString>& selectors) { … }
void FrameContentWatcher::NotifyBrowserOfChange() { … }
}
ContentWatcher::ContentWatcher() = default;
ContentWatcher::~ContentWatcher() = default;
void ContentWatcher::OnWatchPages(
const std::vector<std::string>& new_css_selectors_utf8) { … }
void ContentWatcher::OnRenderFrameCreated(content::RenderFrame* render_frame) { … }
}