#ifndef FLUTTER_INAPPWEBVIEW_PLUGIN_WEBVIEW_ENVIRONMENT_MANAGER_H_ #define FLUTTER_INAPPWEBVIEW_PLUGIN_WEBVIEW_ENVIRONMENT_MANAGER_H_ #include #include #include #include #include "../flutter_inappwebview_windows_plugin.h" #include "../types/channel_delegate.h" #include "webview_environment.h" namespace flutter_inappwebview_plugin { class WebViewEnvironmentManager : public ChannelDelegate { public: static inline const wchar_t* CLASS_NAME = L"WebViewEnvironmentManager"; static inline const std::string METHOD_CHANNEL_NAME = "com.pichillilorenzo/flutter_webview_environment"; const FlutterInappwebviewWindowsPlugin* plugin; std::map> webViewEnvironments; WebViewEnvironmentManager(const FlutterInappwebviewWindowsPlugin* plugin); ~WebViewEnvironmentManager(); void HandleMethodCall( const flutter::MethodCall& method_call, std::unique_ptr> result); void createWebViewEnvironment(const std::string& id, std::unique_ptr settings, std::unique_ptr> result); void createOrGetDefaultWebViewEnvironment(const std::function completionHandler); HWND getHWND() { return hwnd_; } static std::optional getAvailableVersion(std::optional browserExecutableFolder); static std::optional compareBrowserVersions(std::string version1, std::string version2); private: std::unique_ptr defaultEnvironment_; WNDCLASS windowClass_ = {}; HWND hwnd_ = nullptr; }; } #endif //FLUTTER_INAPPWEBVIEW_PLUGIN_WEBVIEW_ENVIRONMENT_MANAGER_H_