linux: Remove all the X and GTK+ related implementations.
Now we only uses GTK+ for app indicator and status icon, also notice the in Chrome35 the Gtk2StatusIcon class doesn't exist yet so we shipp related files under chromium_src, remember to delete them after upgraded to Chrome36.
This commit is contained in:
parent
49160819d2
commit
3349b8e6c7
39 changed files with 426 additions and 3900 deletions
|
@ -1,20 +0,0 @@
|
|||
// Copyright (c) 2013 GitHub, Inc. All rights reserved.
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "atom/browser/ui/accelerator_util.h"
|
||||
|
||||
#include "ui/base/accelerators/accelerator.h"
|
||||
#include "ui/base/accelerators/platform_accelerator_gtk.h"
|
||||
|
||||
namespace accelerator_util {
|
||||
|
||||
void SetPlatformAccelerator(ui::Accelerator* accelerator) {
|
||||
scoped_ptr<ui::PlatformAccelerator> platform_accelerator(
|
||||
new ui::PlatformAcceleratorGtk(
|
||||
GetGdkKeyCodeForAccelerator(*accelerator),
|
||||
GetGdkModifierForAccelerator(*accelerator)));
|
||||
accelerator->set_platform_accelerator(platform_accelerator.Pass());
|
||||
}
|
||||
|
||||
} // namespace accelerator_util
|
|
@ -1,267 +0,0 @@
|
|||
// Copyright (c) 2014 GitHub, Inc. All rights reserved.
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "atom/browser/ui/gtk/app_indicator_icon.h"
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <dlfcn.h>
|
||||
|
||||
#include "base/file_util.h"
|
||||
#include "base/guid.h"
|
||||
#include "base/memory/ref_counted_memory.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "base/threading/sequenced_worker_pool.h"
|
||||
#include "chrome/browser/ui/gtk/menu_gtk.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
#include "ui/gfx/image/image.h"
|
||||
|
||||
namespace {
|
||||
|
||||
typedef enum {
|
||||
APP_INDICATOR_CATEGORY_APPLICATION_STATUS,
|
||||
APP_INDICATOR_CATEGORY_COMMUNICATIONS,
|
||||
APP_INDICATOR_CATEGORY_SYSTEM_SERVICES,
|
||||
APP_INDICATOR_CATEGORY_HARDWARE,
|
||||
APP_INDICATOR_CATEGORY_OTHER
|
||||
} AppIndicatorCategory;
|
||||
|
||||
typedef enum {
|
||||
APP_INDICATOR_STATUS_PASSIVE,
|
||||
APP_INDICATOR_STATUS_ACTIVE,
|
||||
APP_INDICATOR_STATUS_ATTENTION
|
||||
} AppIndicatorStatus;
|
||||
|
||||
typedef AppIndicator* (*app_indicator_new_func)(const gchar* id,
|
||||
const gchar* icon_name,
|
||||
AppIndicatorCategory category);
|
||||
|
||||
typedef AppIndicator* (*app_indicator_new_with_path_func)(
|
||||
const gchar* id,
|
||||
const gchar* icon_name,
|
||||
AppIndicatorCategory category,
|
||||
const gchar* icon_theme_path);
|
||||
|
||||
typedef void (*app_indicator_set_status_func)(AppIndicator* self,
|
||||
AppIndicatorStatus status);
|
||||
|
||||
typedef void (*app_indicator_set_attention_icon_full_func)(
|
||||
AppIndicator* self,
|
||||
const gchar* icon_name,
|
||||
const gchar* icon_desc);
|
||||
|
||||
typedef void (*app_indicator_set_menu_func)(AppIndicator* self, GtkMenu* menu);
|
||||
|
||||
typedef void (*app_indicator_set_icon_full_func)(AppIndicator* self,
|
||||
const gchar* icon_name,
|
||||
const gchar* icon_desc);
|
||||
|
||||
typedef void (*app_indicator_set_icon_theme_path_func)(
|
||||
AppIndicator* self,
|
||||
const gchar* icon_theme_path);
|
||||
|
||||
bool g_attempted_load = false;
|
||||
bool g_opened = false;
|
||||
|
||||
// Retrieved functions from libappindicator.
|
||||
app_indicator_new_func app_indicator_new = NULL;
|
||||
app_indicator_new_with_path_func app_indicator_new_with_path = NULL;
|
||||
app_indicator_set_status_func app_indicator_set_status = NULL;
|
||||
app_indicator_set_attention_icon_full_func
|
||||
app_indicator_set_attention_icon_full = NULL;
|
||||
app_indicator_set_menu_func app_indicator_set_menu = NULL;
|
||||
app_indicator_set_icon_full_func app_indicator_set_icon_full = NULL;
|
||||
app_indicator_set_icon_theme_path_func app_indicator_set_icon_theme_path = NULL;
|
||||
|
||||
void EnsureMethodsLoaded() {
|
||||
if (g_attempted_load)
|
||||
return;
|
||||
|
||||
g_attempted_load = true;
|
||||
|
||||
void* indicator_lib = dlopen("libappindicator.so", RTLD_LAZY);
|
||||
if (!indicator_lib) {
|
||||
indicator_lib = dlopen("libappindicator.so.1", RTLD_LAZY);
|
||||
}
|
||||
if (!indicator_lib) {
|
||||
indicator_lib = dlopen("libappindicator.so.0", RTLD_LAZY);
|
||||
}
|
||||
if (!indicator_lib) {
|
||||
return;
|
||||
}
|
||||
|
||||
g_opened = true;
|
||||
|
||||
app_indicator_new = reinterpret_cast<app_indicator_new_func>(
|
||||
dlsym(indicator_lib, "app_indicator_new"));
|
||||
|
||||
app_indicator_new_with_path =
|
||||
reinterpret_cast<app_indicator_new_with_path_func>(
|
||||
dlsym(indicator_lib, "app_indicator_new_with_path"));
|
||||
|
||||
app_indicator_set_status = reinterpret_cast<app_indicator_set_status_func>(
|
||||
dlsym(indicator_lib, "app_indicator_set_status"));
|
||||
|
||||
app_indicator_set_attention_icon_full =
|
||||
reinterpret_cast<app_indicator_set_attention_icon_full_func>(
|
||||
dlsym(indicator_lib, "app_indicator_set_attention_icon_full"));
|
||||
|
||||
app_indicator_set_menu = reinterpret_cast<app_indicator_set_menu_func>(
|
||||
dlsym(indicator_lib, "app_indicator_set_menu"));
|
||||
|
||||
app_indicator_set_icon_full =
|
||||
reinterpret_cast<app_indicator_set_icon_full_func>(
|
||||
dlsym(indicator_lib, "app_indicator_set_icon_full"));
|
||||
|
||||
app_indicator_set_icon_theme_path =
|
||||
reinterpret_cast<app_indicator_set_icon_theme_path_func>(
|
||||
dlsym(indicator_lib, "app_indicator_set_icon_theme_path"));
|
||||
}
|
||||
|
||||
base::FilePath CreateTempImageFile(gfx::ImageSkia* image_ptr,
|
||||
int icon_change_count,
|
||||
std::string id) {
|
||||
scoped_ptr<gfx::ImageSkia> image(image_ptr);
|
||||
|
||||
scoped_refptr<base::RefCountedMemory> png_data =
|
||||
gfx::Image(*image.get()).As1xPNGBytes();
|
||||
if (png_data->size() == 0) {
|
||||
// If the bitmap could not be encoded to PNG format, skip it.
|
||||
LOG(WARNING) << "Could not encode icon";
|
||||
return base::FilePath();
|
||||
}
|
||||
|
||||
base::FilePath temp_dir;
|
||||
base::FilePath new_file_path;
|
||||
|
||||
// Create a new temporary directory for each image since using a single
|
||||
// temporary directory seems to have issues when changing icons in quick
|
||||
// succession.
|
||||
if (!base::CreateNewTempDirectory(base::FilePath::StringType(), &temp_dir))
|
||||
return base::FilePath();
|
||||
new_file_path =
|
||||
temp_dir.Append(id + base::StringPrintf("_%d.png", icon_change_count));
|
||||
int bytes_written =
|
||||
base::WriteFile(
|
||||
new_file_path,
|
||||
reinterpret_cast<const char*>(png_data->front()),
|
||||
png_data->size());
|
||||
|
||||
if (bytes_written != static_cast<int>(png_data->size()))
|
||||
return base::FilePath();
|
||||
return new_file_path;
|
||||
}
|
||||
|
||||
void DeleteTempImagePath(const base::FilePath& icon_file_path) {
|
||||
if (icon_file_path.empty())
|
||||
return;
|
||||
base::DeleteFile(icon_file_path, true);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
namespace atom {
|
||||
|
||||
AppIndicatorIcon::AppIndicatorIcon()
|
||||
: icon_(NULL),
|
||||
id_(base::GenerateGUID()),
|
||||
icon_change_count_(0),
|
||||
weak_factory_(this) {
|
||||
}
|
||||
|
||||
AppIndicatorIcon::~AppIndicatorIcon() {
|
||||
if (icon_) {
|
||||
app_indicator_set_status(icon_, APP_INDICATOR_STATUS_PASSIVE);
|
||||
g_object_unref(icon_);
|
||||
content::BrowserThread::GetBlockingPool()->PostTask(
|
||||
FROM_HERE,
|
||||
base::Bind(&DeleteTempImagePath, icon_file_path_.DirName()));
|
||||
}
|
||||
}
|
||||
|
||||
bool AppIndicatorIcon::CouldOpen() {
|
||||
EnsureMethodsLoaded();
|
||||
return g_opened;
|
||||
}
|
||||
|
||||
void AppIndicatorIcon::SetImage(const gfx::ImageSkia& image) {
|
||||
if (!g_opened)
|
||||
return;
|
||||
|
||||
++icon_change_count_;
|
||||
|
||||
// We create a deep copy of the image since it may have been freed by the time
|
||||
// it's accessed in the other thread.
|
||||
scoped_ptr<gfx::ImageSkia> safe_image(image.DeepCopy());
|
||||
base::PostTaskAndReplyWithResult(
|
||||
content::BrowserThread::GetBlockingPool()
|
||||
->GetTaskRunnerWithShutdownBehavior(
|
||||
base::SequencedWorkerPool::SKIP_ON_SHUTDOWN).get(),
|
||||
FROM_HERE,
|
||||
base::Bind(&CreateTempImageFile,
|
||||
safe_image.release(),
|
||||
icon_change_count_,
|
||||
id_),
|
||||
base::Bind(&AppIndicatorIcon::SetImageFromFile,
|
||||
weak_factory_.GetWeakPtr()));
|
||||
}
|
||||
|
||||
void AppIndicatorIcon::SetPressedImage(const gfx::ImageSkia& image) {
|
||||
// Ignore pressed images, since the standard on Linux is to not highlight
|
||||
// pressed status icons.
|
||||
}
|
||||
|
||||
void AppIndicatorIcon::SetToolTip(const std::string& tool_tip) {
|
||||
// App indicator doesn't have tooltips:
|
||||
// https://bugs.launchpad.net/indicator-application/+bug/527458
|
||||
}
|
||||
|
||||
void AppIndicatorIcon::SetContextMenu(ui::SimpleMenuModel* menu_model) {
|
||||
// The icon is created asynchronously, wait until the icon has been ready.
|
||||
if (!icon_) {
|
||||
content::BrowserThread::GetBlockingPool()
|
||||
->GetTaskRunnerWithShutdownBehavior(
|
||||
base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)->PostTask(
|
||||
FROM_HERE,
|
||||
base::Bind(&AppIndicatorIcon::SetContextMenu,
|
||||
weak_factory_.GetWeakPtr(),
|
||||
base::Unretained(menu_model)));
|
||||
return;
|
||||
}
|
||||
|
||||
menu_.reset(new MenuGtk(NULL, menu_model));
|
||||
app_indicator_set_menu(icon_, GTK_MENU(menu_->widget()));
|
||||
}
|
||||
|
||||
void AppIndicatorIcon::SetImageFromFile(const base::FilePath& icon_file_path) {
|
||||
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
|
||||
if (icon_file_path.empty())
|
||||
return;
|
||||
|
||||
base::FilePath old_path = icon_file_path_;
|
||||
icon_file_path_ = icon_file_path;
|
||||
|
||||
std::string icon_name =
|
||||
icon_file_path_.BaseName().RemoveExtension().value();
|
||||
std::string icon_dir = icon_file_path_.DirName().value();
|
||||
if (!icon_) {
|
||||
icon_ =
|
||||
app_indicator_new_with_path(id_.c_str(),
|
||||
icon_name.c_str(),
|
||||
APP_INDICATOR_CATEGORY_APPLICATION_STATUS,
|
||||
icon_dir.c_str());
|
||||
app_indicator_set_status(icon_, APP_INDICATOR_STATUS_ACTIVE);
|
||||
} else {
|
||||
// Currently we are creating a new temp directory every time the icon is
|
||||
// set. So we need to set the directory each time.
|
||||
app_indicator_set_icon_theme_path(icon_, icon_dir.c_str());
|
||||
app_indicator_set_icon_full(icon_, icon_name.c_str(), "icon");
|
||||
|
||||
// Delete previous icon directory.
|
||||
content::BrowserThread::GetBlockingPool()->PostTask(
|
||||
FROM_HERE,
|
||||
base::Bind(&DeleteTempImagePath, old_path.DirName()));
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace atom
|
|
@ -1,55 +0,0 @@
|
|||
// Copyright (c) 2014 GitHub, Inc. All rights reserved.
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef ATOM_BROWSER_UI_GTK_APP_INDICATOR_ICON_H_
|
||||
#define ATOM_BROWSER_UI_GTK_APP_INDICATOR_ICON_H_
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "atom/browser/ui/tray_icon.h"
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "ui/base/gtk/gtk_signal.h"
|
||||
|
||||
typedef struct _AppIndicator AppIndicator;
|
||||
typedef struct _GtkWidget GtkWidget;
|
||||
|
||||
class MenuGtk;
|
||||
|
||||
namespace atom {
|
||||
|
||||
class AppIndicatorIcon : public TrayIcon {
|
||||
public:
|
||||
AppIndicatorIcon();
|
||||
virtual ~AppIndicatorIcon();
|
||||
|
||||
// Indicates whether libappindicator so could be opened.
|
||||
static bool CouldOpen();
|
||||
|
||||
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:
|
||||
void SetImageFromFile(const base::FilePath& icon_file_path);
|
||||
|
||||
// Gtk status icon wrapper
|
||||
AppIndicator* icon_;
|
||||
|
||||
// The context menu for this icon (if any).
|
||||
scoped_ptr<MenuGtk> menu_;
|
||||
|
||||
std::string id_;
|
||||
base::FilePath icon_file_path_;
|
||||
int icon_change_count_;
|
||||
|
||||
base::WeakPtrFactory<AppIndicatorIcon> weak_factory_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(AppIndicatorIcon);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
|
||||
#endif // ATOM_BROWSER_UI_GTK_APP_INDICATOR_ICON_H_
|
|
@ -1,56 +0,0 @@
|
|||
// Copyright (c) 2014 GitHub, Inc. All rights reserved.
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "atom/browser/ui/gtk/status_icon.h"
|
||||
|
||||
#include "chrome/browser/ui/gtk/menu_gtk.h"
|
||||
#include "ui/gfx/gtk_util.h"
|
||||
|
||||
namespace atom {
|
||||
|
||||
StatusIcon::StatusIcon() : icon_(gtk_status_icon_new()) {
|
||||
gtk_status_icon_set_visible(icon_, TRUE);
|
||||
|
||||
g_signal_connect(icon_, "activate", G_CALLBACK(OnActivateThunk), this);
|
||||
g_signal_connect(icon_, "popup-menu", G_CALLBACK(OnPopupMenuThunk), this);
|
||||
}
|
||||
|
||||
StatusIcon::~StatusIcon() {
|
||||
gtk_status_icon_set_visible(icon_, FALSE);
|
||||
g_object_unref(icon_);
|
||||
}
|
||||
|
||||
void StatusIcon::SetImage(const gfx::ImageSkia& image) {
|
||||
if (image.isNull())
|
||||
return;
|
||||
|
||||
GdkPixbuf* pixbuf = gfx::GdkPixbufFromSkBitmap(*image.bitmap());
|
||||
gtk_status_icon_set_from_pixbuf(icon_, pixbuf);
|
||||
g_object_unref(pixbuf);
|
||||
}
|
||||
|
||||
void StatusIcon::SetPressedImage(const gfx::ImageSkia& image) {
|
||||
// Ignore pressed images, since the standard on Linux is to not highlight
|
||||
// pressed status icons.
|
||||
}
|
||||
|
||||
void StatusIcon::SetToolTip(const std::string& tool_tip) {
|
||||
gtk_status_icon_set_tooltip_text(icon_, tool_tip.c_str());
|
||||
}
|
||||
|
||||
void StatusIcon::SetContextMenu(ui::SimpleMenuModel* menu_model) {
|
||||
menu_.reset(new MenuGtk(NULL, menu_model));
|
||||
}
|
||||
|
||||
void StatusIcon::OnPopupMenu(GtkWidget* widget, guint button, guint time) {
|
||||
// If we have a menu - display it.
|
||||
if (menu_.get())
|
||||
menu_->PopupAsContextForStatusIcon(time, button, icon_);
|
||||
}
|
||||
|
||||
void StatusIcon::OnActivate(GtkWidget* widget) {
|
||||
NotifyClicked();
|
||||
}
|
||||
|
||||
} // namespace atom
|
|
@ -1,47 +0,0 @@
|
|||
// Copyright (c) 2014 GitHub, Inc. All rights reserved.
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef ATOM_BROWSER_UI_GTK_STATUS_ICON_H_
|
||||
#define ATOM_BROWSER_UI_GTK_STATUS_ICON_H_
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "atom/browser/ui/tray_icon.h"
|
||||
#include "ui/base/gtk/gtk_signal.h"
|
||||
|
||||
class MenuGtk;
|
||||
|
||||
namespace atom {
|
||||
|
||||
class StatusIcon : public TrayIcon {
|
||||
public:
|
||||
StatusIcon();
|
||||
virtual ~StatusIcon();
|
||||
|
||||
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:
|
||||
// Callback invoked when user right-clicks on the status icon.
|
||||
CHROMEGTK_CALLBACK_2(StatusIcon, void, OnPopupMenu, guint, guint);
|
||||
|
||||
// Callback invoked when the icon is clicked.
|
||||
CHROMEGTK_CALLBACK_0(StatusIcon, void, OnActivate);
|
||||
|
||||
// The currently-displayed icon for the window.
|
||||
GtkStatusIcon* icon_;
|
||||
|
||||
// The context menu for this icon (if any).
|
||||
scoped_ptr<MenuGtk> menu_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(StatusIcon);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
|
||||
#endif // ATOM_BROWSER_UI_GTK_STATUS_ICON_H_
|
|
@ -2,17 +2,58 @@
|
|||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "atom/browser/ui/gtk/status_icon.h"
|
||||
#include "atom/browser/ui/gtk/app_indicator_icon.h"
|
||||
#include "atom/browser/ui/tray_icon_gtk.h"
|
||||
|
||||
#include "base/guid.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "chrome/browser/ui/libgtk2ui/app_indicator_icon.h"
|
||||
#include "chrome/browser/ui/libgtk2ui/gtk2_status_icon.h"
|
||||
|
||||
namespace atom {
|
||||
|
||||
TrayIconGtk::TrayIconGtk() {
|
||||
}
|
||||
|
||||
TrayIconGtk::~TrayIconGtk() {
|
||||
}
|
||||
|
||||
void TrayIconGtk::SetImage(const gfx::ImageSkia& image) {
|
||||
if (icon_) {
|
||||
icon_->SetImage(image);
|
||||
return;
|
||||
}
|
||||
|
||||
base::string16 empty;
|
||||
if (libgtk2ui::AppIndicatorIcon::CouldOpen())
|
||||
icon_.reset(
|
||||
new libgtk2ui::AppIndicatorIcon(base::GenerateGUID(), image, empty));
|
||||
else
|
||||
icon_.reset(new libgtk2ui::Gtk2StatusIcon(image, empty));
|
||||
icon_->set_delegate(this);
|
||||
}
|
||||
|
||||
void TrayIconGtk::SetPressedImage(const gfx::ImageSkia& image) {
|
||||
icon_->SetPressedImage(image);
|
||||
}
|
||||
|
||||
void TrayIconGtk::SetToolTip(const std::string& tool_tip) {
|
||||
icon_->SetToolTip(base::UTF8ToUTF16(tool_tip));
|
||||
}
|
||||
|
||||
void TrayIconGtk::SetContextMenu(ui::SimpleMenuModel* menu_model) {
|
||||
icon_->UpdatePlatformContextMenu(menu_model);
|
||||
}
|
||||
|
||||
void TrayIconGtk::OnClick() {
|
||||
}
|
||||
|
||||
bool TrayIconGtk::HasClickAction() {
|
||||
return false;
|
||||
}
|
||||
|
||||
// static
|
||||
TrayIcon* TrayIcon::Create() {
|
||||
if (AppIndicatorIcon::CouldOpen())
|
||||
return new AppIndicatorIcon;
|
||||
else
|
||||
return new StatusIcon;
|
||||
return new TrayIconGtk;
|
||||
}
|
||||
|
||||
} // namespace atom
|
||||
|
|
43
atom/browser/ui/tray_icon_gtk.h
Normal file
43
atom/browser/ui/tray_icon_gtk.h
Normal file
|
@ -0,0 +1,43 @@
|
|||
// Copyright (c) 2014 GitHub, Inc. All rights reserved.
|
||||
// Use of this source code is governed by the MIT license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef ATOM_BROWSER_UI_TRAY_ICON_GTK_H_
|
||||
#define ATOM_BROWSER_UI_TRAY_ICON_GTK_H_
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "atom/browser/ui/tray_icon.h"
|
||||
#include "ui/views/linux_ui/status_icon_linux.h"
|
||||
|
||||
namespace views {
|
||||
class StatusIconLinux;
|
||||
}
|
||||
|
||||
namespace atom {
|
||||
|
||||
class TrayIconGtk : public TrayIcon,
|
||||
public views::StatusIconLinux::Delegate {
|
||||
public:
|
||||
TrayIconGtk();
|
||||
virtual ~TrayIconGtk();
|
||||
|
||||
// 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:
|
||||
// views::StatusIconLinux::Delegate:
|
||||
virtual void OnClick() OVERRIDE;
|
||||
virtual bool HasClickAction() OVERRIDE;
|
||||
|
||||
scoped_ptr<views::StatusIconLinux> icon_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(TrayIconGtk);
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
|
||||
#endif // ATOM_BROWSER_UI_TRAY_ICON_GTK_H_
|
Loading…
Add table
Add a link
Reference in a new issue