| Index: chrome/browser/ui/libgtk2ui/gconf_listener.h
|
| diff --git a/chrome/browser/ui/libgtk2ui/gconf_titlebar_listener.h b/chrome/browser/ui/libgtk2ui/gconf_listener.h
|
| similarity index 64%
|
| rename from chrome/browser/ui/libgtk2ui/gconf_titlebar_listener.h
|
| rename to chrome/browser/ui/libgtk2ui/gconf_listener.h
|
| index 5931a6213b663860fab6bbc2db17869b934e0786..b9451cef6aed4625397ddc9f847101e7cb2c7589 100644
|
| --- a/chrome/browser/ui/libgtk2ui/gconf_titlebar_listener.h
|
| +++ b/chrome/browser/ui/libgtk2ui/gconf_listener.h
|
| @@ -2,8 +2,8 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef CHROME_BROWSER_UI_LIBGTK2UI_GCONF_TITLEBAR_LISTENER_H_
|
| -#define CHROME_BROWSER_UI_LIBGTK2UI_GCONF_TITLEBAR_LISTENER_H_
|
| +#ifndef CHROME_BROWSER_UI_LIBGTK2UI_GCONF_LISTENER_H_
|
| +#define CHROME_BROWSER_UI_LIBGTK2UI_GCONF_LISTENER_H_
|
|
|
| #include <gconf/gconf-client.h>
|
| #include <gtk/gtk.h>
|
| @@ -12,6 +12,7 @@
|
| #include <string>
|
|
|
| #include "base/basictypes.h"
|
| +#include "base/callback_forward.h"
|
| #include "chrome/browser/ui/libgtk2ui/gtk2_signal.h"
|
|
|
| namespace libgtk2ui {
|
| @@ -20,24 +21,28 @@ class Gtk2UI;
|
| // On GNOME desktops, subscribes to the gconf key which controlls button order.
|
| // Everywhere else, SetTiltebarButtons() just calls back into BrowserTitlebar
|
| // with the default ordering.
|
| -class GConfTitlebarListener {
|
| +class GConfListener {
|
| public:
|
| // Sends data to the Gtk2UI when available.
|
| - explicit GConfTitlebarListener(Gtk2UI* delegate);
|
| - ~GConfTitlebarListener();
|
| + explicit GConfListener(Gtk2UI* delegate);
|
| + ~GConfListener();
|
|
|
| private:
|
| // Called whenever the metacity key changes.
|
| - CHROMEG_CALLBACK_2(GConfTitlebarListener, void, OnChangeNotification,
|
| + CHROMEG_CALLBACK_2(GConfListener, void, OnChangeNotification,
|
| GConfClient*, guint, GConfEntry*);
|
|
|
| + void GetAndRegister(const char* key_to_subscribe,
|
| + const base::Callback<void(GConfValue*)>& initial_setter);
|
| +
|
| // Checks |error|. On error, prints out a message and closes the connection
|
| // to GConf and reverts to default mode.
|
| bool HandleGError(GError* error, const char* key);
|
|
|
| // Parses the return data structure from GConf, falling back to the default
|
| // value on any error.
|
| - void ParseAndStoreValue(GConfValue* gconf_value);
|
| + void ParseAndStoreButtonValue(GConfValue* gconf_value);
|
| + void ParseAndStoreMiddleClickValue(GConfValue* gconf_value);
|
|
|
| Gtk2UI* delegate_;
|
|
|
| @@ -45,9 +50,9 @@ class GConfTitlebarListener {
|
| // gconf.
|
| GConfClient* client_;
|
|
|
| - DISALLOW_COPY_AND_ASSIGN(GConfTitlebarListener);
|
| + DISALLOW_COPY_AND_ASSIGN(GConfListener);
|
| };
|
|
|
| } // namespace libgtk2ui
|
|
|
| -#endif // CHROME_BROWSER_UI_LIBGTK2UI_GCONF_TITLEBAR_LISTENER_H_
|
| +#endif // CHROME_BROWSER_UI_LIBGTK2UI_GCONF_LISTENER_H_
|
|
|