Chromium Code Reviews| Index: chrome/browser/ui/libgtk2ui/app_indicator_icon_fallback.h |
| diff --git a/chrome/browser/ui/libgtk2ui/app_indicator_icon_fallback.h b/chrome/browser/ui/libgtk2ui/app_indicator_icon_fallback.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..baa5ded7303a99cf596ff1ce7ad84cf4145a2a7d |
| --- /dev/null |
| +++ b/chrome/browser/ui/libgtk2ui/app_indicator_icon_fallback.h |
| @@ -0,0 +1,62 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_UI_LIBGTK2UI_APP_INDICATOR_ICON_FALLBACK_H_ |
| +#define CHROME_BROWSER_UI_LIBGTK2UI_APP_INDICATOR_ICON_FALLBACK_H_ |
| + |
| +#include "base/memory/scoped_ptr.h" |
| +#include "base/strings/string16.h" |
| +#include "chrome/browser/ui/libgtk2ui/gtk2_signal.h" |
| +#include "ui/base/glib/glib_integers.h" |
| +#include "ui/base/glib/glib_signal.h" |
| +#include "ui/views/linux_ui/status_icon_linux.h" |
| + |
| +typedef struct _GtkStatusIcon GtkStatusIcon; |
| + |
| +namespace gfx { |
| +class ImageSkia; |
| +} |
| + |
| +namespace ui { |
| +class MenuModel; |
| +} |
| + |
| +namespace libgtk2ui { |
| +class AppIndicatorIconMenu; |
| + |
| +// Status icon implementation which uses the system tray X11 spec (via |
| +// GtkStatusIcon). |
| +class AppIndicatorIconFallback : public views::StatusIconLinux { |
|
Elliot Glaysher
2014/05/27 23:25:51
Please rename this to GtkStatusIcon or something.
pkotwicz
2014/05/27 23:50:12
Renamed to Gtk2StatusIcon
|
| + public: |
| + AppIndicatorIconFallback(const gfx::ImageSkia& image, |
| + const base::string16& tool_tip); |
| + virtual ~AppIndicatorIconFallback(); |
| + |
| + // Overridden from views::StatusIconLinux: |
| + virtual void SetImage(const gfx::ImageSkia& image) OVERRIDE; |
| + virtual void SetPressedImage(const gfx::ImageSkia& image) OVERRIDE; |
| + virtual void SetToolTip(const base::string16& tool_tip) OVERRIDE; |
| + virtual void UpdatePlatformContextMenu(ui::MenuModel* menu) OVERRIDE; |
| + virtual void RefreshPlatformContextMenu() OVERRIDE; |
| + |
| + private: |
| + CHROMEG_CALLBACK_0(AppIndicatorIconFallback, void, OnClick, GtkStatusIcon*); |
| + |
| + CHROMEG_CALLBACK_2(AppIndicatorIconFallback, |
| + void, |
| + OnContextMenuRequested, |
| + GtkStatusIcon*, |
| + guint, |
| + guint); |
| + |
| + GtkStatusIcon* gtk_status_icon_; |
| + |
| + scoped_ptr<AppIndicatorIconMenu> menu_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(AppIndicatorIconFallback); |
| +}; |
| + |
| +} // namespace libgtk2ui |
| + |
| +#endif // CHROME_BROWSER_UI_LIBGTK2UI_APP_INDICATOR_ICON_FALLBACK_H_ |