Home | History | Annotate | Download | only in status_icons
      1 // Copyright (c) 2011 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_GTK_STATUS_ICONS_STATUS_ICON_GTK_H_
      6 #define CHROME_BROWSER_UI_GTK_STATUS_ICONS_STATUS_ICON_GTK_H_
      7 #pragma once
      8 
      9 #include <gtk/gtk.h>
     10 
     11 #include "chrome/browser/status_icons/status_icon.h"
     12 #include "ui/base/gtk/gtk_signal.h"
     13 
     14 class MenuGtk;
     15 class SkBitmap;
     16 
     17 class StatusIconGtk : public StatusIcon {
     18  public:
     19   StatusIconGtk();
     20   virtual ~StatusIconGtk();
     21 
     22   // Overridden from StatusIcon:
     23   virtual void SetImage(const SkBitmap& image);
     24   virtual void SetPressedImage(const SkBitmap& image);
     25   virtual void SetToolTip(const string16& tool_tip);
     26   virtual void DisplayBalloon(const string16& title, const string16& contents);
     27 
     28   // Exposed for testing.
     29   CHROMEGTK_CALLBACK_0(StatusIconGtk, void, OnClick);
     30 
     31  protected:
     32   // Overridden from StatusIcon.
     33   virtual void UpdatePlatformContextMenu(ui::MenuModel* menu);
     34 
     35  private:
     36   // Callback invoked when user right-clicks on the status icon.
     37   CHROMEGTK_CALLBACK_2(StatusIconGtk, void, OnPopupMenu, guint, guint);
     38 
     39   // The currently-displayed icon for the window.
     40   GtkStatusIcon* icon_;
     41 
     42   // The context menu for this icon (if any).
     43   scoped_ptr<MenuGtk> menu_;
     44 
     45   DISALLOW_COPY_AND_ASSIGN(StatusIconGtk);
     46 };
     47 
     48 #endif  // CHROME_BROWSER_UI_GTK_STATUS_ICONS_STATUS_ICON_GTK_H_
     49