8f7a48879e
* chore: bump chromium in DEPS to 119.0.6045.0 * chore: update patches * 4864948: Remove legacy-legacy https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/4864948 * 4907760: Remove ui/base/glib/glib_signal.h https://chromium-review.googlesource.com/c/chromium/src/+/4907760 --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
50 lines
1.4 KiB
C++
50 lines
1.4 KiB
C++
// Copyright (c) 2023 Microsoft, Inc.
|
|
// Use of this source code is governed by the MIT license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#ifndef ELECTRON_SHELL_BROWSER_UI_STATUS_ICON_GTK_H_
|
|
#define ELECTRON_SHELL_BROWSER_UI_STATUS_ICON_GTK_H_
|
|
|
|
#include <memory>
|
|
|
|
#include "ui/base/glib/glib_integers.h"
|
|
#include "ui/base/glib/scoped_gobject.h"
|
|
#include "ui/base/glib/scoped_gsignal.h"
|
|
#include "ui/linux/status_icon_linux.h"
|
|
|
|
typedef struct _GtkStatusIcon GtkStatusIcon;
|
|
|
|
namespace electron {
|
|
|
|
namespace gtkui {
|
|
class MenuGtk;
|
|
}
|
|
|
|
class StatusIconGtk : public ui::StatusIconLinux {
|
|
public:
|
|
StatusIconGtk();
|
|
StatusIconGtk(const StatusIconGtk&) = delete;
|
|
StatusIconGtk& operator=(const StatusIconGtk&) = delete;
|
|
~StatusIconGtk() override;
|
|
|
|
// ui::StatusIconLinux:
|
|
void SetIcon(const gfx::ImageSkia& image) override;
|
|
void SetToolTip(const std::u16string& tool_tip) override;
|
|
void UpdatePlatformContextMenu(ui::MenuModel* model) override;
|
|
void RefreshPlatformContextMenu() override;
|
|
void OnSetDelegate() override;
|
|
|
|
private:
|
|
void OnClick(GtkStatusIcon* status_icon);
|
|
void OnContextMenuRequested(GtkStatusIcon* status_icon,
|
|
guint button,
|
|
guint32 activate_time);
|
|
|
|
std::unique_ptr<gtkui::MenuGtk> menu_;
|
|
ScopedGObject<GtkStatusIcon> icon_;
|
|
std::vector<ScopedGSignal> signals_;
|
|
};
|
|
|
|
} // namespace electron
|
|
|
|
#endif // ELECTRON_SHELL_BROWSER_UI_STATUS_ICON_GTK_H_
|