// 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 #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 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 browser_manager_; scoped_refptr render_task_runner_; std::unique_ptr observer_; DISALLOW_COPY_AND_ASSIGN(ChromeContentRendererClientCef); }; #endif // CEF_LIBCEF_RENDERER_CHROME_CHROME_CONTENT_RENDERER_CLIENT_CEF_