diff options
Diffstat (limited to 'src/core/renderer/render_configuration.h')
-rw-r--r-- | src/core/renderer/render_configuration.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/core/renderer/render_configuration.h b/src/core/renderer/render_configuration.h new file mode 100644 index 000000000..d9c867e02 --- /dev/null +++ b/src/core/renderer/render_configuration.h @@ -0,0 +1,42 @@ +// Copyright (C) 2019 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only + +#ifndef RENDER_CONFIGURATION_H +#define RENDER_CONFIGURATION_H + +#include "content/public/renderer/render_thread_observer.h" +#include "mojo/public/cpp/bindings/associated_receiver_set.h" +#include "mojo/public/cpp/bindings/pending_associated_receiver.h" +#include "qtwebengine/common/renderer_configuration.mojom.h" + +namespace QtWebEngineCore { + +class RenderConfiguration : public content::RenderThreadObserver, + public qtwebengine::mojom::RendererConfiguration +{ +public: + RenderConfiguration() = default; + ~RenderConfiguration() override = default; + + static bool is_incognito_process() { return m_isIncognitoProcess; } + +private: + // content::RenderThreadObserver: + void RegisterMojoInterfaces(blink::AssociatedInterfaceRegistry *associated_interfaces) override; + void UnregisterMojoInterfaces(blink::AssociatedInterfaceRegistry *associated_interfaces) override; + + // qtwebengine::mojom::RendererConfiguration: + void SetInitialConfiguration(bool is_incognito_process) override; + + void OnRendererConfigurationAssociatedRequest( + mojo::PendingAssociatedReceiver<qtwebengine::mojom::RendererConfiguration> receiver); + + static bool m_isIncognitoProcess; + + mojo::AssociatedReceiverSet<qtwebengine::mojom::RendererConfiguration> + m_rendererConfigurationReceivers; +}; + +} // namespace QtWebEngineCore + +#endif // RENDER_CONFIGURATION_H |