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.
5 #ifndef CHROME_BROWSER_UI_LIBGTK2UI_GCONF_TITLEBAR_LISTENER_H_
6 #define CHROME_BROWSER_UI_LIBGTK2UI_GCONF_TITLEBAR_LISTENER_H_
8 #include <gconf/gconf-client.h>
14 #include "base/basictypes.h"
15 #include "chrome/browser/ui/libgtk2ui/gtk2_signal.h"
20 // On GNOME desktops, subscribes to the gconf key which controlls button order.
21 // Everywhere else, SetTiltebarButtons() just calls back into BrowserTitlebar
22 // with the default ordering.
23 class GConfTitlebarListener {
25 // Sends data to the Gtk2UI when available.
26 explicit GConfTitlebarListener(Gtk2UI* delegate);
27 ~GConfTitlebarListener();
30 // Called whenever the metacity key changes.
31 CHROMEG_CALLBACK_2(GConfTitlebarListener, void, OnChangeNotification,
32 GConfClient*, guint, GConfEntry*);
34 // Checks |error|. On error, prints out a message and closes the connection
35 // to GConf and reverts to default mode.
36 bool HandleGError(GError* error, const char* key);
38 // Parses the return data structure from GConf, falling back to the default
39 // value on any error.
40 void ParseAndStoreValue(GConfValue* gconf_value);
44 // Pointer to our gconf context. NULL if we aren't on a desktop that uses
48 DISALLOW_COPY_AND_ASSIGN(GConfTitlebarListener);
51 } // namespace libgtk2ui
53 #endif // CHROME_BROWSER_UI_LIBGTK2UI_GCONF_TITLEBAR_LISTENER_H_