2020-09-25 03:40:47 +02:00
|
|
|
// Copyright 2020 The Chromium Embedded Framework Authors.
|
|
|
|
// Portions copyright 2012 The Chromium Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
#ifndef CEF_LIBCEF_RENDERER_CHROME_CHROME_CONTENT_RENDERER_CLIENT_CEF_
|
|
|
|
#define CEF_LIBCEF_RENDERER_CHROME_CHROME_CONTENT_RENDERER_CLIENT_CEF_
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
#include "base/memory/scoped_refptr.h"
|
2021-11-10 22:57:31 +01:00
|
|
|
#include "base/task/single_thread_task_runner.h"
|
2020-09-25 03:40:47 +02:00
|
|
|
#include "chrome/renderer/chrome_content_renderer_client.h"
|
|
|
|
|
2021-05-14 18:58:55 +02:00
|
|
|
class CefRenderManager;
|
2020-09-25 03:40:47 +02:00
|
|
|
|
|
|
|
// CEF override of ChromeContentRendererClient.
|
|
|
|
class ChromeContentRendererClientCef : public ChromeContentRendererClient {
|
|
|
|
public:
|
|
|
|
ChromeContentRendererClientCef();
|
2021-12-06 21:40:25 +01:00
|
|
|
|
|
|
|
ChromeContentRendererClientCef(const ChromeContentRendererClientCef&) =
|
|
|
|
delete;
|
|
|
|
ChromeContentRendererClientCef& operator=(
|
|
|
|
const ChromeContentRendererClientCef&) = delete;
|
|
|
|
|
2020-09-25 03:40:47 +02:00
|
|
|
~ChromeContentRendererClientCef() override;
|
|
|
|
|
|
|
|
// Render thread task runner.
|
|
|
|
base::SingleThreadTaskRunner* render_task_runner() const {
|
|
|
|
return render_task_runner_.get();
|
|
|
|
}
|
|
|
|
|
|
|
|
// Returns the task runner for the current thread. Returns NULL if the current
|
|
|
|
// thread is not the main render process thread.
|
|
|
|
scoped_refptr<base::SingleThreadTaskRunner> GetCurrentTaskRunner();
|
|
|
|
|
|
|
|
// ChromeContentRendererClient overrides.
|
|
|
|
void RenderThreadStarted() override;
|
|
|
|
void RenderThreadConnected() override;
|
|
|
|
void RenderFrameCreated(content::RenderFrame* render_frame) override;
|
2022-07-25 19:49:32 +02:00
|
|
|
void WebViewCreated(blink::WebView* web_view,
|
2022-09-26 21:30:45 +02:00
|
|
|
bool was_created_by_renderer,
|
|
|
|
const url::Origin* outermost_origin) override;
|
2020-09-25 03:40:47 +02:00
|
|
|
void DevToolsAgentAttached() override;
|
|
|
|
void DevToolsAgentDetached() override;
|
2021-05-14 18:58:55 +02:00
|
|
|
void ExposeInterfacesToBrowser(mojo::BinderMap* binders) override;
|
2020-09-25 03:40:47 +02:00
|
|
|
|
|
|
|
private:
|
2021-05-14 18:58:55 +02:00
|
|
|
std::unique_ptr<CefRenderManager> render_manager_;
|
2020-09-25 03:40:47 +02:00
|
|
|
|
|
|
|
scoped_refptr<base::SingleThreadTaskRunner> render_task_runner_;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // CEF_LIBCEF_RENDERER_CHROME_CHROME_CONTENT_RENDERER_CLIENT_CEF_
|