BookmarkManager: Fix 'new folder text field size changes on clicking it' issue.
[chromium-blink-merge.git] / chrome / browser / ui / libgtk2ui / gtk2_status_icon.h
blob89934a78a088996dc6175554f762ddef6d93a293
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.
5 #ifndef CHROME_BROWSER_UI_LIBGTK2UI_GTK2_STATUS_ICON_H_
6 #define CHROME_BROWSER_UI_LIBGTK2UI_GTK2_STATUS_ICON_H_
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"
15 typedef struct _GtkStatusIcon GtkStatusIcon;
17 namespace gfx {
18 class ImageSkia;
21 namespace ui {
22 class MenuModel;
25 namespace libgtk2ui {
26 class AppIndicatorIconMenu;
28 // Status icon implementation which uses the system tray X11 spec (via
29 // GtkStatusIcon).
30 class Gtk2StatusIcon : public views::StatusIconLinux {
31 public:
32 Gtk2StatusIcon(const gfx::ImageSkia& image, const base::string16& tool_tip);
33 ~Gtk2StatusIcon() override;
35 // Overridden from views::StatusIconLinux:
36 void SetImage(const gfx::ImageSkia& image) override;
37 void SetToolTip(const base::string16& tool_tip) override;
38 void UpdatePlatformContextMenu(ui::MenuModel* menu) override;
39 void RefreshPlatformContextMenu() override;
41 private:
42 CHROMEG_CALLBACK_0(Gtk2StatusIcon, void, OnClick, GtkStatusIcon*);
44 CHROMEG_CALLBACK_2(Gtk2StatusIcon,
45 void,
46 OnContextMenuRequested,
47 GtkStatusIcon*,
48 guint,
49 guint);
51 GtkStatusIcon* gtk_status_icon_;
53 scoped_ptr<AppIndicatorIconMenu> menu_;
55 DISALLOW_COPY_AND_ASSIGN(Gtk2StatusIcon);
58 } // namespace libgtk2ui
60 #endif // CHROME_BROWSER_UI_LIBGTK2UI_GTK2_STATUS_ICON_H_