Repository: electron/electron
File: shell/browser/api/electron_api_system_preferences.h (C/C++)

Code before:
#endif

class SystemPreferences final
    : public gin_helper::DeprecatedWrappable<SystemPreferences>,
      public gin_helper::EventEmitterMixin<SystemPreferences>
#if BUILDFLAG(IS_WIN)
    ,
      public BrowserObserver,
      public gfx::SysColorChangeListener
#elif BUILDFLAG(IS_LINUX)
    ,
      public ui::NativeThemeObserver
#endif
{
 public:
  static gin_helper::Handle<SystemPreferences> Create(v8::Isolate* isolate);

  // gin_helper::Wrappable
  static gin::DeprecatedWrapperInfo kWrapperInfo;
  gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
      v8::Isolate* isolate) override;
  const char* GetTypeName() override;

#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC) || BUILDFLAG(IS_LINUX)
  std::string GetAccentColor();
#endif
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
  std::string GetColor(gin_helper::ErrorThrower thrower,
                       const std::string& color);
  std::string GetMediaAccessStatus(gin_helper::ErrorThrower thrower,
                                   const std::string& media_type);
#endif
#if BUILDFLAG(IS_WIN)
  void InitializeWindow();

  // gfx::SysColorChangeListener:
  void OnSysColorChange() override;

  // BrowserObserver:
  void OnFinishLaunching(base::Value::Dict launch_info) override;

#elif BUILDFLAG(IS_MAC)
  using NotificationCallback = base::RepeatingCallback<
      void(const std::string&, base::Value, const std::string&)>;

  void PostNotification(const std::string& name,
                        base::Value::Dict user_info,
                        gin::Arguments* args);
  int SubscribeNotification(v8::Local<v8::Value> maybe_name,
                            const NotificationCallback& callback);
  void UnsubscribeNotification(int id);

Review comment (suggestion):
This doesn't need buildflags if it's supported everywhere!

```suggestion
  std::string GetAccentColor();
```

Code after:
  kNSWorkspaceNotificationCenter,
};
#endif

class SystemPreferences final
    : public gin_helper::DeprecatedWrappable<SystemPreferences>,
      public gin_helper::EventEmitterMixin<SystemPreferences>
#if BUILDFLAG(IS_WIN)
    ,
      public BrowserObserver
#elif BUILDFLAG(IS_LINUX)
    ,
      public ui::NativeThemeObserver
#endif
{
 public:
  static gin_helper::Handle<SystemPreferences> Create(v8::Isolate* isolate);

  // gin_helper::Wrappable
  static gin::DeprecatedWrapperInfo kWrapperInfo;
  gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
      v8::Isolate* isolate) override;
  const char* GetTypeName() override;

  std::string GetAccentColor();
#if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_MAC)
  std::string GetColor(gin_helper::ErrorThrower thrower,
                       const std::string& color);
  std::string GetMediaAccessStatus(gin_helper::ErrorThrower thrower,
                                   const std::string& media_type);
#endif
#if BUILDFLAG(IS_WIN)
  void InitializeWindow();

  // Called by `hwnd_subscription_`.
  void OnWndProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);

  // BrowserObserver:
  void OnFinishLaunching(base::Value::Dict launch_info) override;

#elif BUILDFLAG(IS_MAC)
  using NotificationCallback = base::RepeatingCallback<
      void(const std::string&, base::Value, const std::string&)>;

  void PostNotification(const std::string& name,
                        base::Value::Dict user_info,
                        gin::Arguments* args);
  int SubscribeNotification(v8::Local<v8::Value> maybe_name,
                            const NotificationCallback& callback);
  void UnsubscribeNotification(int id);
  void PostLocalNotification(const std::string& name,