mac: Simple implementation of tray icon.
This commit is contained in:
parent
80fb79daac
commit
6f5184f001
8 changed files with 46 additions and 8 deletions
|
@ -5,9 +5,14 @@
|
|||
#ifndef ATOM_BROWSER_UI_TRAY_ICON_COCOA_H_
|
||||
#define ATOM_BROWSER_UI_TRAY_ICON_COCOA_H_
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "atom/browser/ui/tray_icon.h"
|
||||
#include "base/mac/scoped_nsobject.h"
|
||||
|
||||
@class AtomMenuController;
|
||||
|
||||
namespace atom {
|
||||
|
||||
|
@ -16,11 +21,17 @@ class TrayIconCocoa : public TrayIcon {
|
|||
virtual void SetImage(const gfx::ImageSkia& image) OVERRIDE;
|
||||
virtual void SetPressedImage(const gfx::ImageSkia& image) OVERRIDE;
|
||||
virtual void SetToolTip(const std::string& tool_tip) OVERRIDE;
|
||||
virtual void SetContextMenu(ui::SimpleMenuModel* menu_model) OVERRIDE;
|
||||
|
||||
private:
|
||||
TrayIconCocoa();
|
||||
virtual ~TrayIconCocoa();
|
||||
|
||||
base::scoped_nsobject<NSStatusItem> item_;
|
||||
|
||||
// Status menu shown when right-clicking the system icon.
|
||||
base::scoped_nsobject<AtomMenuController> menu_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(TrayIconCocoa);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue