Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Side by Side Diff: chrome/browser/ui/libgtk2ui/app_indicator_icon_fallback.h

Issue 291893009: Fall back to X11 system tray icons if libappindicator is not available (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_UI_LIBGTK2UI_APP_INDICATOR_ICON_FALLBACK_H_
6 #define CHROME_BROWSER_UI_LIBGTK2UI_APP_INDICATOR_ICON_FALLBACK_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "base/strings/string16.h"
10 #include "chrome/browser/ui/libgtk2ui/gtk2_signal.h"
11 #include "ui/base/glib/glib_integers.h"
12 #include "ui/base/glib/glib_signal.h"
13 #include "ui/views/linux_ui/status_icon_linux.h"
14
15 typedef struct _GtkStatusIcon GtkStatusIcon;
16
17 namespace gfx {
18 class ImageSkia;
19 }
20
21 namespace ui {
22 class MenuModel;
23 }
24
25 namespace libgtk2ui {
26 class AppIndicatorIconMenu;
27
28 // Status icon implementation which uses the system tray X11 spec (via
29 // GtkStatusIcon).
30 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
31 public:
32 AppIndicatorIconFallback(const gfx::ImageSkia& image,
33 const base::string16& tool_tip);
34 virtual ~AppIndicatorIconFallback();
35
36 // Overridden from views::StatusIconLinux:
37 virtual void SetImage(const gfx::ImageSkia& image) OVERRIDE;
38 virtual void SetPressedImage(const gfx::ImageSkia& image) OVERRIDE;
39 virtual void SetToolTip(const base::string16& tool_tip) OVERRIDE;
40 virtual void UpdatePlatformContextMenu(ui::MenuModel* menu) OVERRIDE;
41 virtual void RefreshPlatformContextMenu() OVERRIDE;
42
43 private:
44 CHROMEG_CALLBACK_0(AppIndicatorIconFallback, void, OnClick, GtkStatusIcon*);
45
46 CHROMEG_CALLBACK_2(AppIndicatorIconFallback,
47 void,
48 OnContextMenuRequested,
49 GtkStatusIcon*,
50 guint,
51 guint);
52
53 GtkStatusIcon* gtk_status_icon_;
54
55 scoped_ptr<AppIndicatorIconMenu> menu_;
56
57 DISALLOW_COPY_AND_ASSIGN(AppIndicatorIconFallback);
58 };
59
60 } // namespace libgtk2ui
61
62 #endif // CHROME_BROWSER_UI_LIBGTK2UI_APP_INDICATOR_ICON_FALLBACK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698