diff --git a/include/wx/webview_chromium.h b/include/wx/webview_chromium.h index 7b0094c110..fc831dd3b1 100644 --- a/include/wx/webview_chromium.h +++ b/include/wx/webview_chromium.h @@ -17,7 +17,13 @@ extern WXDLLIMPEXP_DATA_WEBVIEW_CHROMIUM(const char) wxWebViewBackendChromium[]; class wxWebViewChromium; + +// Private namespace containing classes used only in the implementation. +namespace wxCEF +{ class ClientHandler; +struct ImplData; +} class WXDLLIMPEXP_WEBVIEW_CHROMIUM wxWebViewChromium : public wxWebView { @@ -146,12 +152,12 @@ private: // The text of the current page wxString m_pageText; - // Private data used by ClientHandler. - struct wxWebViewChromiumImplData* m_implData = nullptr; + // Private data used by wxCEFClientHandler. + struct wxCEF::ImplData* m_implData = nullptr; - // We also friend ClientHandler so it can access m_implData. - friend class ClientHandler; - ClientHandler* m_clientHandler; + // We also friend wxCEFClientHandler so it can access m_implData. + friend class wxCEF::ClientHandler; + wxCEF::ClientHandler* m_clientHandler; friend class wxWebViewChromiumModule; static bool ms_cefInitialized; diff --git a/src/common/webview_chromium.cpp b/src/common/webview_chromium.cpp index b1e265a325..62468666eb 100644 --- a/src/common/webview_chromium.cpp +++ b/src/common/webview_chromium.cpp @@ -69,11 +69,14 @@ bool wxWebViewChromium::ms_cefInitialized = false; wxIMPLEMENT_DYNAMIC_CLASS(wxWebViewChromium, wxWebView); +namespace wxCEF +{ + // ---------------------------------------------------------------------------- -// wxWebViewChromiumImplData +// ImplData // ---------------------------------------------------------------------------- -struct wxWebViewChromiumImplData +struct ImplData { #ifdef __WXGTK__ // Due to delayed creation of the browser in wxGTK we need to remember the @@ -268,9 +271,6 @@ private: IMPLEMENT_REFCOUNTING(wxStringVisitor); }; -namespace -{ - class wxBrowserProcessHandler : public CefBrowserProcessHandler { public: @@ -348,7 +348,9 @@ private: IMPLEMENT_REFCOUNTING(wxCefApp); }; -} // anonymous namespace +} // namespace wxCEF + +using namespace wxCEF; bool wxWebViewChromium::Create(wxWindow* parent, wxWindowID id, @@ -383,7 +385,7 @@ bool wxWebViewChromium::Create(wxWindow* parent, m_historyPosition = -1; m_zoomLevel = wxWEBVIEW_ZOOM_MEDIUM; - m_implData = new wxWebViewChromiumImplData{}; + m_implData = new ImplData{}; m_clientHandler = new ClientHandler{*this}; m_clientHandler->AddRef();