52 lines
1.8 KiB
C
52 lines
1.8 KiB
C
|
// 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/macros.h"
|
||
|
#include "base/memory/scoped_refptr.h"
|
||
|
#include "base/single_thread_task_runner.h"
|
||
|
#include "chrome/renderer/chrome_content_renderer_client.h"
|
||
|
|
||
|
class CefBrowserManager;
|
||
|
class CefRenderThreadObserver;
|
||
|
|
||
|
// CEF override of ChromeContentRendererClient.
|
||
|
class ChromeContentRendererClientCef : public ChromeContentRendererClient {
|
||
|
public:
|
||
|
ChromeContentRendererClientCef();
|
||
|
~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;
|
||
|
void RenderViewCreated(content::RenderView* render_view) override;
|
||
|
void DevToolsAgentAttached() override;
|
||
|
void DevToolsAgentDetached() override;
|
||
|
|
||
|
private:
|
||
|
std::unique_ptr<CefBrowserManager> browser_manager_;
|
||
|
|
||
|
scoped_refptr<base::SingleThreadTaskRunner> render_task_runner_;
|
||
|
std::unique_ptr<CefRenderThreadObserver> observer_;
|
||
|
|
||
|
DISALLOW_COPY_AND_ASSIGN(ChromeContentRendererClientCef);
|
||
|
};
|
||
|
|
||
|
#endif // CEF_LIBCEF_RENDERER_CHROME_CHROME_CONTENT_RENDERER_CLIENT_CEF_
|