refactor: prefer to inherit observer classes privately (#41360)

* refactor: use private inheritance in CookieChangeNotifier

* refactor: use private inheritance in WebViewGuestDelegate

* refactor: use private inheritance in UsbChooserController

* refactor: use private inheritance in DesktopCapturer

* refactor: use private inheritance in Browser

* refactor: use private inheritance in WebContentsZoomController

* refactor: use private inheritance in FrameSubscriber

* refactor: use private inheritance in AutofillAgent

* refactor: use private inheritance in HidChooserController

* refactor: use private inheritance in PepperHelper

* refactor: use private inheritance in AutofillPopup

* refactor: use private inheritance in SerialChooserController

* refactor: use private inheritance in MediaCaptureDevicesDispatcher

* refactor: use private inheritance in electron::api::View

* refactor: use private inheritance in AutofillDriverFactory

* refactor: use private inheritance in GPUInfoManager

* refactor: use private inheritance in SavePageHandler

* refactor: use private inheritance in GlobalShortcut

* refactor: use private inheritance in ElectronRenderFrameObserver
This commit is contained in:
Charles Kerr 2024-05-21 14:21:31 -05:00 committed by GitHub
parent 23a5d8b64a
commit 752efddf89
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 37 additions and 33 deletions

View file

@ -21,9 +21,9 @@
namespace electron {
class AutofillAgent : public content::RenderFrameObserver,
public blink::WebAutofillClient,
public mojom::ElectronAutofillAgent {
class AutofillAgent : private content::RenderFrameObserver,
private blink::WebAutofillClient,
private mojom::ElectronAutofillAgent {
public:
explicit AutofillAgent(content::RenderFrame* frame,
blink::AssociatedInterfaceRegistry* registry);

View file

@ -16,7 +16,7 @@ namespace electron {
class RendererClientBase;
// Helper class to forward the messages to the client.
class ElectronRenderFrameObserver : public content::RenderFrameObserver {
class ElectronRenderFrameObserver : private content::RenderFrameObserver {
public:
ElectronRenderFrameObserver(content::RenderFrame* frame,
RendererClientBase* renderer_client);
@ -26,6 +26,7 @@ class ElectronRenderFrameObserver : public content::RenderFrameObserver {
ElectronRenderFrameObserver& operator=(const ElectronRenderFrameObserver&) =
delete;
private:
// content::RenderFrameObserver:
void DidClearWindowObject() override;
void DidInstallConditionalFeatures(v8::Handle<v8::Context> context,
@ -35,7 +36,6 @@ class ElectronRenderFrameObserver : public content::RenderFrameObserver {
void OnDestruct() override;
void DidMeaningfulLayout(blink::WebMeaningfulLayout layout_type) override;
private:
[[nodiscard]] bool ShouldNotifyClient(int world_id) const;
void CreateIsolatedWorldContext();

View file

@ -11,7 +11,7 @@
// This class listens for Pepper creation events from the RenderFrame and
// attaches the parts required for plugin support.
class PepperHelper : public content::RenderFrameObserver {
class PepperHelper : private content::RenderFrameObserver {
public:
explicit PepperHelper(content::RenderFrame* render_frame);
~PepperHelper() override;
@ -20,6 +20,7 @@ class PepperHelper : public content::RenderFrameObserver {
PepperHelper(const PepperHelper&) = delete;
PepperHelper& operator=(const PepperHelper&) = delete;
private:
// RenderFrameObserver.
void DidCreatePepperPlugin(content::RendererPpapiHost* host) override;
void OnDestruct() override;