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

Unified Diff: chrome/browser/ui/libgtk2ui/app_indicator_icon.h

Issue 304933002: Revert of 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/libgtk2ui/app_indicator_icon.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/libgtk2ui/app_indicator_icon.h
diff --git a/chrome/browser/ui/libgtk2ui/app_indicator_icon.h b/chrome/browser/ui/libgtk2ui/app_indicator_icon.h
index dc952316b8988b8508f91b0dde1bfe344d5fc292..99da811bc0b63275a4a1aa62950d0ad17970a101 100644
--- a/chrome/browser/ui/libgtk2ui/app_indicator_icon.h
+++ b/chrome/browser/ui/libgtk2ui/app_indicator_icon.h
@@ -6,7 +6,6 @@
#define CHROME_BROWSER_UI_LIBGTK2UI_APP_INDICATOR_ICON_H_
#include "base/files/file_path.h"
-#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "chrome/browser/ui/libgtk2ui/gtk2_signal.h"
#include "ui/views/linux_ui/status_icon_linux.h"
@@ -23,9 +22,7 @@
}
namespace libgtk2ui {
-class AppIndicatorIconMenu;
-// Status icon implementation which uses libappindicator.
class AppIndicatorIcon : public views::StatusIconLinux {
public:
// The id uniquely identifies the new status icon from other chrome status
@@ -49,13 +46,18 @@
void SetImageFromFile(const base::FilePath& icon_file_path);
void SetMenu();
- // Sets a menu item at the top of the menu as a replacement for the status
- // icon click action. Clicking on this menu item should simulate a status icon
- // click by despatching a click event.
- void UpdateClickActionReplacementMenuItem();
+ // Adds a menu item to the top of the existing gtk_menu as a replacement for
+ // the status icon click action or creates a new gtk menu with the menu item
+ // if a menu doesn't exist. Clicking on this menu item should simulate a
+ // status icon click by despatching a click event.
+ void CreateClickActionReplacement();
+ void DestroyMenu();
- // Callback for when the status icon click replacement menu item is activated.
- void OnClickActionReplacementMenuItemActivated();
+ // Callback for when the status icon click replacement menu item is clicked.
+ CHROMEGTK_CALLBACK_0(AppIndicatorIcon, void, OnClick);
+
+ // Callback for when a menu item is clicked.
+ CHROMEGTK_CALLBACK_0(AppIndicatorIcon, void, OnMenuItemActivated);
std::string id_;
std::string tool_tip_;
@@ -63,11 +65,12 @@
// Gtk status icon wrapper
AppIndicator* icon_;
- scoped_ptr<AppIndicatorIconMenu> menu_;
+ GtkWidget* gtk_menu_;
ui::MenuModel* menu_model_;
base::FilePath icon_file_path_;
int icon_change_count_;
+ bool block_activation_;
base::WeakPtrFactory<AppIndicatorIcon> weak_factory_;
« no previous file with comments | « no previous file | chrome/browser/ui/libgtk2ui/app_indicator_icon.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698