feat: allow macOS tray to maintain position (#47838)

* feat: allow macOS tray to maintain position

* refactor: just use guid

* test: fixup tests

* docs: clarify UUID format
This commit is contained in:
Shelley Vohr 2025-08-07 19:25:50 +02:00 committed by GitHub
commit a0d983e4b5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 101 additions and 34 deletions

View file

@ -45,7 +45,7 @@ class Tray final : public gin_helper::DeprecatedWrappable<Tray>,
// gin_helper::Constructible
static gin_helper::Handle<Tray> New(gin_helper::ErrorThrower thrower,
v8::Local<v8::Value> image,
std::optional<UUID> guid,
std::optional<base::Uuid> guid,
gin::Arguments* args);
static void FillObjectTemplate(v8::Isolate*, v8::Local<v8::ObjectTemplate>);
@ -65,7 +65,7 @@ class Tray final : public gin_helper::DeprecatedWrappable<Tray>,
private:
Tray(v8::Isolate* isolate,
v8::Local<v8::Value> image,
std::optional<UUID> guid);
std::optional<base::Uuid> guid);
~Tray() override;
// TrayIconObserver:
@ -111,10 +111,12 @@ class Tray final : public gin_helper::DeprecatedWrappable<Tray>,
void SetContextMenu(gin_helper::ErrorThrower thrower,
v8::Local<v8::Value> arg);
gfx::Rect GetBounds();
v8::Local<v8::Value> GetGUID();
bool CheckAlive();
v8::Global<v8::Value> menu_;
std::optional<base::Uuid> guid_;
std::unique_ptr<TrayIcon> tray_icon_;
};