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

Unified Diff: chrome/browser/ui/gtk/gconf_titlebar_listener.h

Issue 11338028: Add support for XFWM titlebar buttons. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 2 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
Index: chrome/browser/ui/gtk/gconf_titlebar_listener.h
===================================================================
--- chrome/browser/ui/gtk/gconf_titlebar_listener.h (revision 164859)
+++ chrome/browser/ui/gtk/gconf_titlebar_listener.h (working copy)
@@ -12,35 +12,23 @@
#include <string>
#include "base/basictypes.h"
+#include "chrome/browser/ui/gtk/titlebar_listener.h"
#include "ui/base/gtk/gtk_signal.h"
-class BrowserTitlebar;
-template <typename T> struct DefaultSingletonTraits;
-
// On GNOME desktops, subscribes to the gconf key which controlls button order.
-// Everywhere else, SetTiltebarButtons() just calls back into BrowserTitlebar
+// Everywhere else, SetTitlebarButtons() just calls back into BrowserTitlebar
// with the default ordering.
-//
-// Meant to be used as a Singleton through base/memory/singleton.h's interface.
-class GConfTitlebarListener {
+class GConfTitlebarListener : public TitlebarListener::Delegate {
public:
- // Returns the singleton instance.
- static GConfTitlebarListener* GetInstance();
+ GConfTitlebarListener();
- // Sets the current titlebar button order. On GNOME desktops, also subscribes
- // to further notifications when this changes.
- void SetTitlebarButtons(BrowserTitlebar* titlebar);
-
- // Removes |titlebar| from the list of objects observing button order change
- // notifications.
- void RemoveObserver(BrowserTitlebar* titlebar);
-
- protected:
+ private:
+ // Refcounted.
~GConfTitlebarListener();
- private:
- // Private constructor to enforce singleton access.
- GConfTitlebarListener();
+ // TitlebarListener::Delegate implementation.
+ virtual bool Init() OVERRIDE;
+ virtual std::string GetCurrentValue() OVERRIDE;
// Called whenever the metacity key changes.
CHROMEG_CALLBACK_2(GConfTitlebarListener, void, OnChangeNotification,
@@ -61,10 +49,6 @@
// The current button ordering as heard from gconf.
std::string current_value_;
- // BrowserTitlebar objects which have subscribed to updates.
- std::set<BrowserTitlebar*> titlebars_;
-
- friend struct DefaultSingletonTraits<GConfTitlebarListener>;
DISALLOW_COPY_AND_ASSIGN(GConfTitlebarListener);
};

Powered by Google App Engine
This is Rietveld 408576698