| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_GTK_STATUS_ICONS_STATUS_ICON_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_STATUS_ICONS_STATUS_ICON_GTK_H_ |
| 6 #define 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 | 7 #pragma once |
| 8 | 8 |
| 9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
| 10 | 10 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "chrome/browser/status_icons/desktop_notification_balloon.h" | |
| 13 #include "chrome/browser/status_icons/status_icon.h" | 12 #include "chrome/browser/status_icons/status_icon.h" |
| 14 #include "ui/base/gtk/gtk_signal.h" | 13 #include "ui/base/gtk/gtk_signal.h" |
| 15 | 14 |
| 16 class MenuGtk; | 15 class MenuGtk; |
| 17 class SkBitmap; | 16 class SkBitmap; |
| 18 | 17 |
| 19 class StatusIconGtk : public StatusIcon { | 18 class StatusIconGtk : public StatusIcon { |
| 20 public: | 19 public: |
| 21 StatusIconGtk(); | 20 StatusIconGtk(); |
| 22 virtual ~StatusIconGtk(); | 21 virtual ~StatusIconGtk(); |
| 23 | 22 |
| 24 // Overridden from StatusIcon: | 23 // Overridden from StatusIcon: |
| 25 virtual void SetImage(const SkBitmap& image) OVERRIDE; | 24 virtual void SetImage(const SkBitmap& image) OVERRIDE; |
| 26 virtual void SetPressedImage(const SkBitmap& image) OVERRIDE; | 25 virtual void SetPressedImage(const SkBitmap& image) OVERRIDE; |
| 27 virtual void SetToolTip(const string16& tool_tip) OVERRIDE; | 26 virtual void SetToolTip(const string16& tool_tip) OVERRIDE; |
| 28 virtual void DisplayBalloon(const SkBitmap& icon, | 27 virtual void DisplayBalloon(const SkBitmap& icon, |
| 29 const string16& title, | 28 const string16& title, |
| 30 const string16& contents) OVERRIDE; | 29 const string16& contents); |
| 31 | 30 |
| 32 // Exposed for testing. | 31 // Exposed for testing. |
| 33 CHROMEGTK_CALLBACK_0(StatusIconGtk, void, OnClick); | 32 CHROMEGTK_CALLBACK_0(StatusIconGtk, void, OnClick); |
| 34 | 33 |
| 35 protected: | 34 protected: |
| 36 // Overridden from StatusIcon. | 35 // Overridden from StatusIcon. |
| 37 virtual void UpdatePlatformContextMenu(ui::MenuModel* menu); | 36 virtual void UpdatePlatformContextMenu(ui::MenuModel* menu); |
| 38 | 37 |
| 39 private: | 38 private: |
| 40 // Callback invoked when user right-clicks on the status icon. | 39 // Callback invoked when user right-clicks on the status icon. |
| 41 CHROMEGTK_CALLBACK_2(StatusIconGtk, void, OnPopupMenu, guint, guint); | 40 CHROMEGTK_CALLBACK_2(StatusIconGtk, void, OnPopupMenu, guint, guint); |
| 42 | 41 |
| 43 // The currently-displayed icon for the window. | 42 // The currently-displayed icon for the window. |
| 44 GtkStatusIcon* icon_; | 43 GtkStatusIcon* icon_; |
| 45 | 44 |
| 46 // The context menu for this icon (if any). | 45 // The context menu for this icon (if any). |
| 47 scoped_ptr<MenuGtk> menu_; | 46 scoped_ptr<MenuGtk> menu_; |
| 48 | 47 |
| 49 // Notification balloon. | |
| 50 DesktopNotificationBalloon notification_; | |
| 51 | |
| 52 DISALLOW_COPY_AND_ASSIGN(StatusIconGtk); | 48 DISALLOW_COPY_AND_ASSIGN(StatusIconGtk); |
| 53 }; | 49 }; |
| 54 | 50 |
| 55 #endif // CHROME_BROWSER_UI_GTK_STATUS_ICONS_STATUS_ICON_GTK_H_ | 51 #endif // CHROME_BROWSER_UI_GTK_STATUS_ICONS_STATUS_ICON_GTK_H_ |
| OLD | NEW |