#ifndef WEBLAYER_RENDERER_WEBLAYER_RENDER_THREAD_OBSERVER_H_
#define WEBLAYER_RENDERER_WEBLAYER_RENDER_THREAD_OBSERVER_H_
#include "components/content_settings/common/content_settings_manager.mojom.h"
#include "content/public/renderer/render_thread_observer.h"
#include "mojo/public/cpp/bindings/associated_receiver_set.h"
#include "weblayer/common/renderer_configuration.mojom.h"
namespace weblayer {
class WebLayerRenderThreadObserver : public content::RenderThreadObserver,
public mojom::RendererConfiguration {
public:
WebLayerRenderThreadObserver();
~WebLayerRenderThreadObserver() override;
content_settings::mojom::ContentSettingsManager* content_settings_manager() {
if (content_settings_manager_)
return content_settings_manager_.get();
return nullptr;
}
private:
void RegisterMojoInterfaces(
blink::AssociatedInterfaceRegistry* associated_interfaces) override;
void UnregisterMojoInterfaces(
blink::AssociatedInterfaceRegistry* associated_interfaces) override;
void SetInitialConfiguration(
mojo::PendingRemote<content_settings::mojom::ContentSettingsManager>
content_settings_manager) override;
void OnRendererConfigurationAssociatedRequest(
mojo::PendingAssociatedReceiver<mojom::RendererConfiguration> receiver);
mojo::Remote<content_settings::mojom::ContentSettingsManager>
content_settings_manager_;
mojo::AssociatedReceiverSet<mojom::RendererConfiguration>
renderer_configuration_receivers_;
};
}
#endif