mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
* chore: bump chromium in DEPS to 116.0.5805.2 * chore: bump chromium in DEPS to 116.0.5807.0 * chore: update patches * chore: bump chromium in DEPS to 116.0.5809.2 * chore: bump chromium in DEPS to 116.0.5811.0 * chore: bump chromium in DEPS to 116.0.5813.0 * chore: bump chromium in DEPS to 116.0.5815.0 * chore: bump chromium in DEPS to 116.0.5817.0 * chore: bump chromium in DEPS to 116.0.5819.0 * chore: bump chromium in DEPS to 116.0.5821.0 * chore: bump chromium in DEPS to 116.0.5823.0 * chore: bump chromium in DEPS to 116.0.5825.0 * chore: bump chromium in DEPS to 116.0.5827.0 * chore: bump chromium to 116.0.5817.0 cherry picked fromfd5e6fbc14* refactor: add ARC scaffolding for macOS (#38621) (cherry picked from commit9a9d8ae5ea) --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
59 lines
1.5 KiB
C++
59 lines
1.5 KiB
C++
// Copyright (c) 2014 GitHub, 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_TRAY_ICON_LINUX_H_
|
|
#define ELECTRON_SHELL_BROWSER_UI_TRAY_ICON_LINUX_H_
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
|
|
#include "shell/browser/ui/tray_icon.h"
|
|
#include "ui/linux/status_icon_linux.h"
|
|
|
|
class StatusIconLinuxDbus;
|
|
|
|
namespace electron {
|
|
|
|
class StatusIconGtk;
|
|
|
|
class TrayIconLinux : public TrayIcon, public ui::StatusIconLinux::Delegate {
|
|
public:
|
|
TrayIconLinux();
|
|
~TrayIconLinux() override;
|
|
|
|
// TrayIcon:
|
|
void SetImage(const gfx::Image& image) override;
|
|
void SetToolTip(const std::string& tool_tip) override;
|
|
void SetContextMenu(raw_ptr<ElectronMenuModel> menu_model) override;
|
|
|
|
// ui::StatusIconLinux::Delegate
|
|
void OnClick() override;
|
|
bool HasClickAction() override;
|
|
const gfx::ImageSkia& GetImage() const override;
|
|
const std::u16string& GetToolTip() const override;
|
|
ui::MenuModel* GetMenuModel() const override;
|
|
void OnImplInitializationFailed() override;
|
|
|
|
private:
|
|
enum class StatusIconType {
|
|
kDbus,
|
|
kGtk,
|
|
kNone,
|
|
};
|
|
|
|
ui::StatusIconLinux* GetStatusIcon();
|
|
|
|
scoped_refptr<StatusIconLinuxDbus> status_icon_dbus_;
|
|
std::unique_ptr<StatusIconGtk> status_icon_gtk_;
|
|
StatusIconType status_icon_type_;
|
|
|
|
gfx::ImageSkia image_;
|
|
std::u16string tool_tip_;
|
|
raw_ptr<ui::MenuModel> menu_model_ = nullptr;
|
|
};
|
|
|
|
} // namespace electron
|
|
|
|
#endif // ELECTRON_SHELL_BROWSER_UI_TRAY_ICON_LINUX_H_
|