refactor: inherit Observer classes privately, pt. 2 (#42237)

* refactor: use private inheritance in PushNotifications

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

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

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

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

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

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

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

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

* refactor: use private inheritance in ClearDataOperation

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

* refactor: use private inheritance in electron::ElectronDesktopWindowTreeHostLinux

* refactor: use private inheritance in SpellCheckerHolder

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

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

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

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

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

* refactor: use private inheritance in electron::ElectronBrowserClient

* refactor: use private inheritance in electron::AutofillPopupView

* refactor: use private inheritance in GtkMessageBox

* refactor: use private inheritance in electron::OffScreenRenderWidgetHostView

* refactor: use private inheritance in electron::InspectableWebContents

* refactor: use private inheritance in electron::ElectronUsbDelegate

* refactor: use private inheritance in electron::LoginHandler

* refactor: use private inheritance in WebFrameRenderer

* refactor: use private inheritance in electron::ElectronSerialDelegate

* refactor: use private inheritance in electron::ClientFrameViewLinux

* refactor: use private inheritance in electron::ElectronHidDelegate

* refactor: use private inheritance in IPCRenderer

* refactor: use private inheritance in electron::WinCaptionButtonContainer

* refactor: use private inheritance in electron::ElectronApiIPCHandlerImpl

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

* refactor: use private inheritance in ui::FileSelectHelper

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

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

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

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

* refactor: use private inheritance in electron::ElectronWebContentsUtilityHandlerImpl

* refactor: use private inheritance in electron::OffScreenWebContentsView
This commit is contained in:
Charles Kerr 2024-05-29 13:07:02 -05:00 committed by GitHub
parent 705d92c5f6
commit ae0c55c0b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
39 changed files with 54 additions and 54 deletions

View file

@ -50,9 +50,9 @@ namespace api {
class App : public ElectronBrowserClient::Delegate,
public gin::Wrappable<App>,
public gin_helper::EventEmitterMixin<App>,
public BrowserObserver,
public content::GpuDataManagerObserver,
public content::BrowserChildProcessObserver {
private BrowserObserver,
private content::GpuDataManagerObserver,
private content::BrowserChildProcessObserver {
public:
using FileIconCallback =
base::RepeatingCallback<void(v8::Local<v8::Value>, const gfx::Image&)>;

View file

@ -18,7 +18,7 @@ namespace electron::api {
class AutoUpdater : public gin::Wrappable<AutoUpdater>,
public gin_helper::EventEmitterMixin<AutoUpdater>,
public auto_updater::Delegate,
public WindowListObserver {
private WindowListObserver {
public:
static gin::Handle<AutoUpdater> Create(v8::Isolate* isolate);

View file

@ -26,7 +26,7 @@ namespace electron::api {
class View;
class BaseWindow : public gin_helper::TrackableObject<BaseWindow>,
public NativeWindowObserver {
private NativeWindowObserver {
public:
static gin_helper::WrappableBase* New(gin_helper::Arguments* args);

View file

@ -16,8 +16,8 @@
namespace electron::api {
class BrowserWindow : public BaseWindow,
public content::WebContentsObserver,
public ExtendedWebContentsObserver {
private content::WebContentsObserver,
private ExtendedWebContentsObserver {
public:
static gin_helper::WrappableBase* New(gin_helper::ErrorThrower thrower,
gin::Arguments* args);

View file

@ -28,7 +28,7 @@ namespace electron::api {
class Debugger : public gin::Wrappable<Debugger>,
public gin_helper::EventEmitterMixin<Debugger>,
public content::DevToolsAgentHostClient,
public content::WebContentsObserver {
private content::WebContentsObserver {
public:
static gin::Handle<Debugger> Create(v8::Isolate* isolate,
content::WebContents* web_contents);

View file

@ -24,7 +24,7 @@ namespace electron::api {
class DownloadItem : public gin::Wrappable<DownloadItem>,
public gin_helper::Pinnable<DownloadItem>,
public gin_helper::EventEmitterMixin<DownloadItem>,
public download::DownloadItem::Observer {
private download::DownloadItem::Observer {
public:
static gin::Handle<DownloadItem> FromOrCreate(v8::Isolate* isolate,
download::DownloadItem* item);

View file

@ -20,7 +20,7 @@ namespace electron::api {
class InAppPurchase : public gin::Wrappable<InAppPurchase>,
public gin_helper::EventEmitterMixin<InAppPurchase>,
public in_app_purchase::TransactionObserver {
private in_app_purchase::TransactionObserver {
public:
static gin::Handle<InAppPurchase> Create(v8::Isolate* isolate);

View file

@ -24,7 +24,7 @@ class Menu : public gin::Wrappable<Menu>,
public gin_helper::Constructible<Menu>,
public gin_helper::Pinnable<Menu>,
public ElectronMenuModel::Delegate,
public ElectronMenuModel::Observer {
private ElectronMenuModel::Observer {
public:
// gin_helper::Constructible
static gin::Handle<Menu> New(gin::Arguments* args);

View file

@ -16,7 +16,7 @@ namespace electron::api {
class NativeTheme : public gin::Wrappable<NativeTheme>,
public gin_helper::EventEmitterMixin<NativeTheme>,
public ui::NativeThemeObserver {
private ui::NativeThemeObserver {
public:
static gin::Handle<NativeTheme> Create(v8::Isolate* isolate);

View file

@ -20,9 +20,9 @@ namespace electron::api {
class PowerMonitor : public gin::Wrappable<PowerMonitor>,
public gin_helper::EventEmitterMixin<PowerMonitor>,
public gin_helper::Pinnable<PowerMonitor>,
public base::PowerStateObserver,
public base::PowerSuspendObserver,
public base::PowerThermalObserver {
private base::PowerStateObserver,
private base::PowerSuspendObserver,
private base::PowerThermalObserver {
public:
static v8::Local<v8::Value> Create(v8::Isolate* isolate);

View file

@ -21,7 +21,7 @@ class PushNotifications
: public ElectronBrowserClient::Delegate,
public gin::Wrappable<PushNotifications>,
public gin_helper::EventEmitterMixin<PushNotifications>,
public BrowserObserver {
private BrowserObserver {
public:
static PushNotifications* Get();
static gin::Handle<PushNotifications> Create(v8::Isolate* isolate);

View file

@ -24,7 +24,7 @@ namespace electron::api {
class Screen : public gin::Wrappable<Screen>,
public gin_helper::EventEmitterMixin<Screen>,
public display::DisplayObserver {
private display::DisplayObserver {
public:
static v8::Local<v8::Value> Create(gin_helper::ErrorThrower error_thrower);

View file

@ -21,7 +21,7 @@ namespace api {
class ServiceWorkerContext
: public gin::Wrappable<ServiceWorkerContext>,
public gin_helper::EventEmitterMixin<ServiceWorkerContext>,
public content::ServiceWorkerContextObserver {
private content::ServiceWorkerContextObserver {
public:
static gin::Handle<ServiceWorkerContext> Create(
v8::Isolate* isolate,

View file

@ -262,7 +262,7 @@ class ClearDataTask {
// of a full |ClearDataTask|. This class manages its own lifetime, cleaning
// itself up after the operation completes and notifies the task of the
// result.
class ClearDataOperation : public BrowsingDataRemover::Observer {
class ClearDataOperation : private BrowsingDataRemover::Observer {
public:
static void Run(std::shared_ptr<ClearDataTask> task,
BrowsingDataRemover* remover,

View file

@ -65,12 +65,12 @@ class Session : public gin::Wrappable<Session>,
public gin_helper::EventEmitterMixin<Session>,
public gin_helper::CleanedUpAtExit,
#if BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)
public SpellcheckHunspellDictionary::Observer,
private SpellcheckHunspellDictionary::Observer,
#endif
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
public extensions::ExtensionRegistryObserver,
private extensions::ExtensionRegistryObserver,
#endif
public content::DownloadManager::Observer {
private content::DownloadManager::Observer {
public:
// Gets or creates Session from the |browser_context|.
static gin::Handle<Session> CreateFrom(

View file

@ -39,7 +39,7 @@ class Tray : public gin::Wrappable<Tray>,
public gin_helper::Constructible<Tray>,
public gin_helper::CleanedUpAtExit,
public gin_helper::Pinnable<Tray>,
public TrayIconObserver {
private TrayIconObserver {
public:
// gin_helper::Constructible
static gin::Handle<Tray> New(gin_helper::ErrorThrower thrower,

View file

@ -111,7 +111,7 @@ class WebContents : public ExclusiveAccessContext,
public gin_helper::CleanedUpAtExit,
public content::WebContentsObserver,
public content::WebContentsDelegate,
public content::RenderWidgetHost::InputEventObserver,
private content::RenderWidgetHost::InputEventObserver,
public content::JavaScriptDialogManager,
public InspectableWebContentsDelegate,
public InspectableWebContentsViewDelegate,

View file

@ -21,7 +21,7 @@ namespace electron::api {
class WebContents;
class WebContentsView : public View,
public content::WebContentsObserver,
private content::WebContentsObserver,
public DraggableRegionProvider {
public:
// Create a new instance of WebContentsView.