WebBrowserContext.h 971 B

123456789101112131415161718192021222324252627282930313233
  1. #pragma once
  2. #include "WallpaperEngine/Application/ApplicationContext.h"
  3. #include "include/cef_app.h"
  4. #include "include/cef_browser_process_handler.h"
  5. #include "include/wrapper/cef_helpers.h"
  6. #include <string>
  7. #define WPENGINE_SCHEME "wp"
  8. namespace WallpaperEngine::Application {
  9. class WallpaperApplication;
  10. }
  11. namespace WallpaperEngine::WebBrowser::CEF {
  12. class BrowserApp;
  13. }
  14. namespace WallpaperEngine::WebBrowser {
  15. class WebBrowserContext {
  16. public:
  17. explicit WebBrowserContext (WallpaperEngine::Application::WallpaperApplication& wallpaperApplication);
  18. ~WebBrowserContext ();
  19. private:
  20. CefRefPtr<CefApp> m_browserApplication = nullptr;
  21. CefRefPtr<CefCommandLine> m_commandLine = nullptr;
  22. // Chromium profile of this process, created under the temp directory and removed once CEF is shut down
  23. std::string m_cachePath;
  24. WallpaperEngine::Application::WallpaperApplication& m_wallpaperApplication;
  25. };
  26. } // namespace WallpaperEngine::WebBrowser